【发布时间】:2013-01-09 17:15:29
【问题描述】:
我有一个 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];
【问题讨论】:
-
“无法正常工作”……这是怎么回事?
标签: iphone ios objective-c core-animation calayer