Gibt es eine Möglichkeit, eine CABasicAnimation anzuhalten?

Ich habe eine grundlegende Spinning-Animation für das iPhone. Kann ich die Animation auf irgendeine Weise "pausieren", damit die Position der Ansicht beibehalten wird? Ich schätze, eine Möglichkeit, dies zu tun, besteht darin, die Animation zu "vervollständigen", anstatt "entfernen" aufzurufen. Wie würde ich das tun?

CABasicAnimation* rotationAnimation;
rotationAnimation = [CABasicAnimation animationWithKeyPath:@"transform.rotation.z"];
rotationAnimation.toValue = [NSNumber numberWithFloat: M_PI * 2];
rotationAnimation.duration = 100;
rotationAnimation.cumulative = YES;
rotationAnimation.repeatCount = HUGE_VALF;
rotationAnimation.removedOnCompletion = NO;
rotationAnimation.fillMode = kCAFillModeForwards;
[myView.layer addAnimation:rotationAnimation forKey:@"rotationAnimation"];

Antworten auf die Frage(5)

Ihre Antwort auf die Frage