自定義的圖片實現(xiàn)旋轉(zhuǎn)的動畫
偿荷、檐春、顽聂、
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;//你可以設(shè)置到最大的整數(shù)值
rotationAnimation.cumulative = NO;
rotationAnimation.removedOnCompletion = NO;
rotationAnimation.fillMode = kCAFillModeForwards;
[self.hudImageView.layer addAnimation:rotationAnimation forKey:@"Rotation"];
肥惭、、紊搪、