How do I change or disable the rotating animation when screen orientation changes from landscape to portrait, or vice versa?
views:
265answers:
2
+3
A:
If you dont want your view controllers to rotate just override the shouldAutoRotateToInterface view controller method to return false for whichever orientation you dont want to support...Here is a reference.
In the case that u just want to handle rotation some other way, you can return false in the above methods and register for UIDeviceOrientationDidChangeNotification like so
NSNotificationCenter* nc = [NSNotificationCenter defaultCenter];
[nc addObserver:self
selector:@selector(handleOrientationDidChange:)
name:UIDeviceOrientationDidChangeNotification
object:nil];
Now when u get the notifications u can do whatever you want with it...
Daniel
2010-04-29 16:05:52
I think he still wants it to rotate but to use a different animation or not animate at all.
Flash84x
2010-04-29 16:14:02
changed answer to reflect that
Daniel
2010-04-29 17:18:16
that did the trick.
Aldrich
2010-04-30 09:28:14