我正在开发一个应用程序,其中我旋转了360度的视图,但我无法旋转360度。 已经越来越被旋转180度后得到旋转时,它正在回到它原来的位置..如何以360度旋转3D视图?
animation = [CABasicAnimation animationWithKeyPath:@"transform"];
transform = CATransform3DMakeRotation(3.14f, 1.0f, 1.0f, 1.0f);
value = [NSValue valueWithCATransform3D:transform];
[animation setToValue:value];
[animation setAutoreverses:YES];
[animation setDuration:0.9];
[[rotatBall layer] addAnimation:animation forKey:@"180"]; //rotatBall is a view
换句话说,它正在来回转动。 如何不断旋转它.... 请帮助...
2弧度,但每当我写2,它甚至不动 –
你可能想[查看你的数学(http://www.google.com/search?q=how+many+radians+是+ 360 +度)。另外,你可能会发现常量M_PI有帮助。 – rickster
我的意思是180 * 2 ...即使我写了6.28,但没有结果..请帮助 –