Landscape UIView in a UITabBarController
-
18-09-2019 - |
Question
I have a UITabbarController with (so far) two navigation controller items. I can get the application to rotate by adding the shouldAutorotateToInterfaceOrientation to each class... but thats not exactly what I want.
What I want to do is to add a button in the UINavigationBar in one of the classes. When this button is pressed I want it to load another view into landscape mode. This view should not show any navigationbar or tabbar controller.
How can I get this to work?
Best regards, Paul Peelen
Solution
You can try to use approach similar to Apple's AlternateViews sample.
Basically you should:
- Create your landscape view with appropriate size (480x300 for landscape if standard statusbar is visible)
- In your button handler push your landscape calling
-pushModalViewController
on your current view controller - Apply necessary affine transformation to your view to be displayed correctly in landscape.
OTHER TIPS
Use presentModalViewController:animated:
and implement the modal view controller's shouldAutorotateToInterfaceOrientation:
accordingly.