图片的旋转可以在UIView一层,也可以在CALayer一层,当需要在UIView一层时,主要的旋转操作为:
[UIView animateWithDuration:0.1 animations:^{
_view.transform = CGAffineTransformMakeRotation(M_PI);
}];
这里面的M_PI旋转180°是相对于view初始化时的位置,若想继续操作回到原来位置需要将角度设置为0
[UIView animateWithDuration:0.1 animations:^{
_view.transform = CGAffineTransformMakeRotation(0);
}];