我现在正在旋转一个圆形箭头。这很酷,但我希望在结束时像其他视图一样有一些更精致的东西,你可以为它们设置动画以缓入或缓出,我想知道您是否可以为此做同样的事情..这是我的代码..
- (IBAction)animator:(id)sender
{
[arrowRotation removeFromSuperview];
//arrow animation
arrowRotation = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"arrow.png"]];
arrowRotation.frame = CGRectMake(148.0, 20.0, 30.0, 30.0);
[self.view addSubview:arrowRotation];
CABasicAnimation *fullRotation;
fullRotation = [CABasicAnimation animationWithKeyPath:@"transform.rotation"];
fullRotation.fromValue = [NSNumber numberWithFloat:0];
fullRotation.toValue = [NSNumber numberWithFloat:((360*M_PI)/180)];
fullRotation.duration = 0.75f;
fullRotation.repeatCount = 3;
[arrowRotation.layer addAnimation:fullRotation forKey:@"360"];
}
所以我的问题是,当涉及到 3 次旋转时,我可以让这个动画变慢。就像 UIView 的轻松。如果这有意义..
任何帮助将不胜感激。