0
我有这段代码来移动视图。CAAnimation:动画后不要重置
CABasicAnimation *theAnimation;
theAnimation=[CABasicAnimation animationWithKeyPath:@"transform.translation.x"];
theAnimation.duration=1;
theAnimation.repeatCount=1;
theAnimation.autoreverses=NO;
theAnimation.fromValue=[NSNumber numberWithFloat:0];
theAnimation.toValue=[NSNumber numberWithFloat:-60];
[view.layer addAnimation:theAnimation forKey:@"animateLayer"];
问题是:动画完成后,视图的实际坐标被复位。在动画完成后,视图是否可能保留在新的坐标上?
谢谢。
谢谢。我发现了另一个答案: [theAnimation setFillMode:kCAFillModeForwards]; 然后它工作正常。感谢您的链接。 – user688262 2012-01-13 20:35:27