views:

229

answers:

2

Hi,

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

+3  A: 

Use presentModalViewController:animated: and implement the modal view controller's shouldAutorotateToInterfaceOrientation: accordingly.

Ole Begemann
+3  A: 

You can try to use approach similar to Apple's AlternateViews sample.
Basically you should:

  1. Create your landscape view with appropriate size (480x300 for landscape if standard statusbar is visible)
  2. In your button handler push your landscape calling -pushModalViewController on your current view controller
  3. Apply necessary affine transformation to your view to be displayed correctly in landscape.
Vladimir
Thanks, I got it working using the alternateViews sample.
Paul Peelen