views:

38

answers:

1

Is there a way to enable rotation but without the animation 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

A: 

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

Human-Behind