views:

1290

answers:

2

I want to create an application that doesn't use Portrait mode.

I am not sure if I need to edit the plist or have code in addition to the plist

+6  A: 

Code found here

Launching in Landscape Mode

Applications in iPhone OS normally launch in portrait mode to match the orientation of the Home screen. If you have an application that runs in both portrait and landscape modes, your application should always launch in portrait mode initially and then let its view controllers rotate the interface as needed based on the device’s orientation. If your application runs in landscape mode only, however, you must perform the following steps to make it launch in a landscape orientation initially.

  • In your application’s Info.plist file, add the UIInterfaceOrientation
    key and set its value to the
    landscape mode. For landscape
    orientations, you can set the value
    of this key to
    UIInterfaceOrientationLandscapeLeft
    or
    UIInterfaceOrientationLandscapeRight.

  • Lay out your views in landscape mode and make sure that their autoresizing options are set correctly.

  • Override your view controller’s shouldAutorotateToInterfaceOrientation: method and return YES only for the
    desired landscape orientation and NO
    for portrait orientations.

Justin Gregoire
@Justin Gregoire, Thanks. It really helpful.
RRB
+2  A: 

edit the plist to only support landscape, then make sure that in every uiviewcontroller/uitabbar etc., in the shouldAutoRotateToInterfaceOrientation, the return says return ((interfaceOrientation == UIInterfaceOrientationLandscapeLeft) || (interfaceOrientation == UIInterfaceOrientationLandscapeRight));.

jrtc27