我有一个 UIView,我想在给定的 T 时间内围绕它的中心点旋转 N 次。并且旋转的速度应该逐渐降低。(像一个旋转轮)。我有下面的代码,它不能正常工作。
float T = 5; // 5 seconds
float rotations = 10;
//_containerView is the view to be rotate
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:T];
[UIView setAnimationRepeatCount:0];
[UIView setAnimationDelegate:self];
[UIView setAnimationCurve:UIViewAnimationCurveEaseOut];
CGAffineTransform t = CGAffineTransformRotate(_containerView.transform, (2*M_PI*rotations + 0));
_containerView.transform = t;
[UIView commitAnimations];