我正在尝试制作一个 iPhone/iPad 应用程序,目前正在尝试让图像缓慢旋转 360 度。但是当我增加动画持续时间时,图片会旋转 1/4,然后重置回动画的开头。
谁能告诉我这有什么问题吗?
到目前为止我所拥有的:
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"];
最佳答案
只需从代码中删除这一行:
fullRotation.speed = .5f;
然后调整您想要的持续时间。
关于iphone - 更平滑的慢速旋转 UIImage,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16656910/