sas*_*eve 12
对于2D旋转使用:
//rotate label in 45 degrees
label.transform = CGAffineTransformMakeRotation( M_PI/4 );
Run Code Online (Sandbox Code Playgroud)
对于3D转换,请参阅此主题:
CATransform3D _3Dt = CATransform3DMakeRotation(radians(90.0f), 1.0, 0.0, 0.0);
Run Code Online (Sandbox Code Playgroud)
小智 9
// flipping view along axis
// this will rotate view in 3D along any axis
[UIView beginAnimations:nil context:nil];
CATransform3D _3Dt = CATransform3DRotate(self.layer.transform, 3.14, 1.0, 0.0,0.0);
[UIView setAnimationRepeatCount:100];
[UIView setAnimationDuration:0.08];
self.layer.transform=_3Dt;
[UIView commitAnimations];
Run Code Online (Sandbox Code Playgroud)