UIImageView transform.translation.x 动画在完成 toValue Process.for 后如何继续。例如:当按下按钮#1:从 1 到 55,按下按钮#2 从 55 到 110 ....如果它在按钮#2 的位置,然后单击按钮#5,然后从 55*2 变为 55*5。
- (void)animateArrow{
CABasicAnimation *theAnimation;
theAnimation=[CABasicAnimation animationWithKeyPath:@"transform.translation.x"];
theAnimation.duration=0.4;
theAnimation.repeatCount=1;
theAnimation.toValue=[NSNumber numberWithFloat:50];
[buttonArrow.layer setValue:theAnimation.toValue forKey:theAnimation.keyPath];
[buttonArrow.layer addAnimation:theAnimation forKey:@"transform.translation.x"];
}