我希望UIView能够在不停止的情况下围绕Y轴进行360度旋转。
答案 0 :(得分:1)
将以下代码放在视图控制器中:
CATransform3D t3d = CATransform3DIdentity;
// m34 sets the amount of perspective
t3d.m34 = 1.0/-1000.0;
[UIView animateWithDuration:1.0
delay:0.0
options:UIViewAnimationCurveLinear
animations:^{
self.view.layer.transform = CATransform3DRotate(t3d, M_PI, 0, 1, 0);
}
completion:^(BOOL finished) {
[UIView animateWithDuration:1.0
delay:0.0
options:UIViewAnimationCurveLinear
animations:^{
self.view.layer.transform = CATransform3DRotate(t3d, 2*M_PI, 0, 1, 0);
}
completion:^(BOOL finished) {
self.view.layer.transform = CATransform3DIdentity;
}];
}];
如果有人对如何清除这一点有任何建议,那就太乱了,请告诉我;)