-(
void
)starRotating
{
_centerView.frame = CGRectMake((kDeviceWidth-kDeviceWidth/4)/2, kDeviceHeight/2-kDeviceWidth/4, kDeviceWidth/4, kDeviceWidth/4);
[_centerView setImage:[UIImage imageNamed: @"loading_bkgnd.png" ]];
[ self addSubview:_centerView];
_rotateView.frame = CGRectMake((kDeviceWidth-kDeviceWidth/4)/2, kDeviceHeight/2-kDeviceWidth/4, kDeviceWidth/4, kDeviceWidth/4);
[_rotateView setImage:[UIImage imageNamed: @"loading_circle.png" ]];
[ self addSubview:_rotateView];
CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath: @"transform" ];
animation.delegate = self ;
{
_centerView.frame = CGRectMake((kDeviceWidth-kDeviceWidth/4)/2, kDeviceHeight/2-kDeviceWidth/4, kDeviceWidth/4, kDeviceWidth/4);
[_centerView setImage:[UIImage imageNamed: @"loading_bkgnd.png" ]];
[ self addSubview:_centerView];
_rotateView.frame = CGRectMake((kDeviceWidth-kDeviceWidth/4)/2, kDeviceHeight/2-kDeviceWidth/4, kDeviceWidth/4, kDeviceWidth/4);
[_rotateView setImage:[UIImage imageNamed: @"loading_circle.png" ]];
[ self addSubview:_rotateView];
CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath: @"transform" ];
animation.delegate = self ;
//参数说明:(M_PI , 0, 0, 0.1) M_PI:翻转角度 M_PI = 180顺时钟;
// 0:0:0 = (x,y,z) x轴指向天,y指向右,z指向自己
animation.toValue = [NSValue valueWithCATransform3D:CATransform3DMakeRotation(M_PI , 0, 0, 0.1)];
animation.duration = 0.5;
animation.cumulative = YES ;
animation.repeatCount = INT_MAX;
[_rotateView.layer addAnimation:animation forKey: @"animation ” ];
}
animation.toValue = [NSValue valueWithCATransform3D:CATransform3DMakeRotation(M_PI , 0, 0, 0.1)];
animation.duration = 0.5;
animation.cumulative = YES ;
animation.repeatCount = INT_MAX;
[_rotateView.layer addAnimation:animation forKey: @"animation ” ];
}