Search code examples
ipadstoryboardlandscape

Storyboard ipad in landscape orientation only


I'm creating an iPad application that supports ONLY LANDSDCAPE mode. I'm using storyboards.

Even after doing the below, while the simulator starts up in the landscape mode, the application starts up in the portrait mode only. Pls help in how can I make the application start up in landscape mode and retain that mode throughout.

  1. shouldautorotate is set YES for landscape
  2. initial interface orientation in info.plist is set to landscape
  3. supported interface orientation in info.plist is set to landscape
  4. simulated metrics for viewcontrollers are set to inferred.

thanks in advance for the help. I've searched on the web but the answer to this is not available.


Solution

  • Under simulated metric choose "Landscape".

    Also make sure you have this method in your view controller implementations:

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