0

我是ios开发新手。我在我的项目中使用圆形图像。在前景模式下,圆形图像旋转得很好。现在我点击了主页按钮。之后我重新启动应用程序,圆圈没有旋转。

这是我的代码:

CABasicAnimation* animation = [CABasicAnimation animationWithKeyPath:@"transform.rotation.z"];
animation.fromValue = [NSNumber numberWithFloat: 2*M_PI];
animation.toValue = [NSNumber numberWithFloat:0.0f];
animation.duration = 4.0f;
animation.repeatCount = INFINITY;
[imageLeft.layer addAnimation:animation forKey:@"SpinAnimation"];

我想在启动应用程序时旋转圆形图像。

4

0 回答 0