CABasicAnimation* rotationAnimation = CABasicAnimation animationWithKeyPath:@"transform.rotation.z"];
rotationAnimation.toValue = NSNumber numberWithFloat:(DEGREES_TO_RADIANS(160))];
//rotationAnimation.toValue = ;
rotationAnimation.duration = 1.0f;
rotationAnimation.delegate = self;
rotationAnimation.autoreverses = NO; // Very convenient CA feature for an animation like this
rotationAnimation.timingFunction = CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
pinLayer addAnimation:rotationAnimation forKey:@"revItUpAnimation"];
这是一段让指针从起始位置旋转到目标位置的动画代码,但我现在的需求是希望指针能在目标位置停留,而不是回到原位置,我需要怎么修改,求助啊!谢谢大家了。