There is no way to always restrict a UIViewController to one orientation
| Originator: | Lee.Falin | ||
| Number: | rdar://6399924 | Date Originated: | 25-Nov-2008 |
| Status: | Duplicate/5855845 | Resolved: | |
| Product: | iPhone SDK | Product Version: | 2.2 |
| Classification: | Serious Bug | Reproducible: | Always |
Summary: When a UIViewController is part of a UINavigationController, the behavior defined in -(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation is ignored. Steps to reproduce: - Create UIViewController and have shouldAutorotateToInterfaceOrientation only return YES for portrait mode. - Create a second UIViewController and have shouldAutorotateToInterfaceOrientation always return YES - Use a UINavigationController to push the second view controller onto the navigation stack - Rotate the device - Use the UINavigationController's back button to go back to pop the second controller off the stack. Expected Results: Since the first view controller says it doesn't support landscape mode, it should not be rotated. Actual Results: shouldAutorotateToInterfaceOrientation is ignored, and the view is rotated anyway. Sample Code: http://leefalin.com/projects/code/radar_6399924.zip 02-Dec-2008 09:30 PM from Apple, they are aware of and are tracking this issue under bug id 5855845.
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!
I have the same (frustrating) issue, and I've logged a radar (6409481).
I'm implementing support for landscape orientation through and through. It isn't too hard, but I'm noticing that performance is lacking.
Brian M. Criscuolo Mark/Space, Inc.
Thanks
Thanks for your complete bug report. I am in the very same case.
Ran into this myself. Definitely sounds like a bug to me.
My workaround - disable the "back" button while the device is in landscape mode. Total hack, but gets around the problem for now.