0
我想獲得UIView圍繞Y軸360度旋轉而不停止的效果。如何做UIView不間斷翻轉動畫
我想獲得UIView圍繞Y軸360度旋轉而不停止的效果。如何做UIView不間斷翻轉動畫
將下面的代碼在您的視圖控制器:
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;
}];
}];
這是相當混亂,如果任何人對如何清除這件事,讓我知道什麼建議;)
由於生病嘗試 – Eyal