【发布时间】:2013-05-20 19:28:35
【问题描述】:
我正在尝试制作一个 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"];
【问题讨论】:
-
总而言之,我只是想在没有任何停顿的情况下进行平稳的连续旋转。
标签: iphone ios objective-c animation image-rotation