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