iOS7、iOS8中的CGAffineTransformRotate、view的旋转方向问题

主题 : iOS7、iOS8中的CGAffineTransformRotate、view的旋转问题

        [UIView animateWithDuration:4 animations:^{
            self.mainMenu.centerbutton.transform = CGAffineTransformMakeRotation(-M_PI_2);
        } completion:^(BOOL finished) {
                
        }];
        [UIView animateWithDuration:4 animations:^{
            self.mainMenu.centerbutton.transform = CGAffineTransformMakeRotation(-M_PI);
        } completion:^(BOOL finished) {
            
        }];
        [UIView animateWithDuration:4 animations:^{
            self.mainMenu.centerbutton.transform = CGAffineTransformMakeRotation(-M_PI_2*3);
        } completion:^(BOOL finished) {
            
        }];
        [UIView animateWithDuration:4 animations:^{
            self.mainMenu.centerbutton.transform = CGAffineTransformMakeRotation(-M_PI*2);
        } completion:^(BOOL finished) {
            
        }];

1. transform rotate -M_PI : iOS7上先是逆时针,后是顺时针(即对一个控件旋转两次,会出现顺逆两种方向。);而在iOS8上,始终都是顺时针方向。 

2. transform rotate -M_PI_2 : iOS7和iOS8上,都是逆时针旋转,如果是rotate M_PI_2,则都是顺时针旋转。 

你可能感兴趣的:(ios,动画)