开发者

Is there a way to do rotation in UIViewController without animation?

Is there a way to enable rotation but without the anima开发者_C百科tion as you turn the device from portrait to landscape?

I'm looking at:

- (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration

... but I don't see how I can set the "duration" property to 0 and thus eliminate the animation. Perhaps there is a better way?

Thanks


You can use the transform property of a UIView to rotate your view immediately :

CGAffineTransform trans = CGAffineTransformMakeRotation(180.0);
yourView.transform = trans;

Hope it will help.

More information available here

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜