views:

18

answers:

2

I'm trying to make a landscape app that uses navigation controller, but I can't get the app to launch in lanscape mode. Once I'm in another view and I use [self.navigation popToRootViewControllerAnimated:YES]; then the root view is in landscape. Why isn't it in landscape from the launch of the app.

I've already put it in landscape mode in Interface Builder and I've already implemented the following code.

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    // Return YES for supported orientations
    return (interfaceOrientation == UIInterfaceOrientationLandscapeRight);


}

Can someone please explain this to me. Am I supposed to be doing something in the appdelegate?

A: 

try adding the key-value pair 'supported interface orientations' in the plist of the application.

Jesse Naugher
That doesn't appear to have worked.
NextRev
+1  A: 

See the Info.plist key reference. In particular, set either

  • <key>UIInterfaceOrientation</key> <string>UIInterfaceOrientationLandscapeRight</string>
  • <key>UISupportedInterfaceOrientations</key> <array> <string>UIInterfaceOrientationLandscapeRight</string> <string>UIInterfaceOrientationLandscapeLeft</string> </array>

The second one lets your app start up in both orientations, but is only supported on OS 3.2+, so you probably want to include the first one as well. "LandscapeRight" seems more common than "LandscapeLeft" for landscape-only apps.

tc.