只需要创建一个imgview,然后赋予图片和坐标
粘贴下面的代码就好啦。。。
旋转动画开启
- (void)rotateView:(UIImageView *)view
{
CABasicAnimation *rotationAnimation;
rotationAnimation = [CABasicAnimation animationWithKeyPath:@"transform.rotation.z"];
rotationAnimation.toValue = [NSNumber numberWithFloat:M_PI*2.0];
rotationAnimation.duration = 1;
rotationAnimation.repeatCount = HUGE_VALF;
[view.layer addAnimation:rotationAnimation forKey:@"rotationAnimation"];
}
结束
[self.loadImgView.layer removeAllAnimations];
本文介绍如何使用 iOS 的 Core Animation 框架为 UIImageView 创建无限旋转动画效果。通过简单的代码实现, 使得 UIImageView 中的图片能够进行连续的 360 度旋转。
2681

被折叠的 条评论
为什么被折叠?



