自定义的图片实现旋转的动画
、、、
self.hudImageView = [[UIImageView alloc] init];
[self.hudImageView setImage:SLImageName(@"loading")];
[self addSubview:self.hudImageView];
CABasicAnimation* rotationAnimation;
rotationAnimation = [CABasicAnimation animationWithKeyPath:@"transform.rotation.z"];
rotationAnimation.toValue = [NSNumber numberWithFloat: M_PI * 2.0 ];
[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
rotationAnimation.duration = 2;
rotationAnimation.repeatCount = FLT_MAX;//你可以设置到最大的整数值
rotationAnimation.cumulative = NO;
rotationAnimation.removedOnCompletion = NO;
rotationAnimation.fillMode = kCAFillModeForwards;
[self.hudImageView.layer addAnimation:rotationAnimation forKey:@"Rotation"];
、、、