如何旋转imageview而不是滞后?

时间:2013-06-11 19:22:42

标签: iphone ios ipad cocoa-touch

我在我的应用程序中集成了指南针,但问题是旋转时图像视图滞后。我怎样才能解决这个问题,让它像苹果的应用程序一样,以一种很好的方式旋转?

以下是我正在使用的代码:

float heading = -1.0f * M_PI * degree / 180.0f;
[UIView animateWithDuration:1.0f delay:0 options:UIViewAnimationOptionCurveEaseOut animations:^{
    self.compassImageView.transform = CGAffineTransformMakeRotation(heading);
} completion:nil];

以下是指南针:

http://i.stack.imgur.com/JXF9A.png

1 个答案:

答案 0 :(得分:1)

摆脱animateWithDuration持续时间。你不需要它。我想你想要它,因为你希望动作平滑,但我有一个类似的应用程序,显示滚动和音调,我只是打电话

tiltImage.transform = CGAffineTransformMakeRotation(DegreesToRadians(angle));

它顺利进行。

你只是在这里思考它。 (JustSid是对的。)

相关问题