2013-05-20 170 views
0

我正在尝试制作iPhone/iPad应用程序,并且我正在尝试让图像慢慢旋转360度。但是,当我增加动画持续时间时,图片将以1/4的方式旋转,然后重置回动画的开头。平滑器慢速旋转UIImage

有谁能告诉我这有什么问题吗?

我有什么至今:

CABasicAnimation *fullRotation = [CABasicAnimation animationWithKeyPath:@"transform.rotation"]; 
[fullRotation setFromValue:[NSNumber numberWithFloat:0]]; 
[fullRotation setToValue:[NSNumber numberWithFloat:((2*M_PI))]]; 
fullRotation.speed = .5f; 
fullRotation.duration = 5.5; 
fullRotation.repeatCount = 1; 

fullRotation.repeatCount = HUGE_VALF; 

[[cosmic layer] addAnimation:fullRotation forKey:@"transform.rotation"]; 
+0

总结一下,我只是试图做一个平稳的连续旋转没有任何暂停。 –

回答

1

刚刚从你的代码中删除这一行:

fullRotation.speed = .5f; 

,然后调整要时间。