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
精彩评论