Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8448935
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T10:33:34+00:00 2026-06-10T10:33:34+00:00

This topic has come up before ( iPad modal view controller acting in portrait

  • 0

This topic has come up before (iPad modal view controller acting in portrait even though it's landscape) but I haven’t found a clear answer – so I don’t know if this is a duplicate or not.

In new single view project, I set the main view to landscape in xcode:

enter image description here

And the Property Inspector confirms this (as well as how the view is displayed in the storyboard):

enter image description here

And the ViewController orientation property is set to landscape:

enter image description here

Yet when I check the view frame in ‘viewDidLoad’ it reports portrait mode:

- (void)viewDidLoad
{
    [super viewDidLoad];

    CGRect theRect = self.view.frame;

    NSLog(@" frame %f  %f  %f  %f", theRect.origin.x,
          theRect.origin.y,
          theRect.size.width,
          theRect.size.height);
}

2012-08-26 16:42:45.045 Test[2320:f803] cell 0.000000 20.000000
768.000000 1004.000000

I also force landscape in shouldAutorotateToInterfaceOrientation:

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    return UIInterfaceOrientationIsLandscape(interfaceOrientation);
}

I’ve encountered this many times before and have had to set the frame explicitly to landscape but I have never understood why all the storyboard settings have no effect.

Am I missing something basic here?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T10:33:36+00:00Added an answer on June 10, 2026 at 10:33 am

    Every application in iOS starts in portrait mode inititally, even if you specified the supported device orientations and give the right “answers” at shouldAutorotateToInterfaceOrientation:. It will always start in portrait and will the rotate to landscape if the device. The user maybe won’t see it cause its so fast.
    Because of this your app has to be able to rotate via shouldAutorotateToInterfaceOrientation even if your only supported orientations are landscape ones.

    So to get a landscape orientation after start you should:

    • set the supported interface orientations in Xcodes Interface Builder
    • overide shouldAutorotateToInterfaceOrientation:

    - (BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)io {
        return (io == UIInterfaceOrientationLandscapeRight); 
    }
    
    • give the interface a chance to rotate and do your view configuration afterwards

    Regarding your question about the Xcode configuration of the the viewcontroller to landscape: Notice the title of the menu in the storyboard – it says: Simulated Metrics
    This means that every modification you do there is just for the purpose to simulate it in the storyboard. But unless you do the necessary modifications to get to this state in the code it will have no effect.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This topic has been discussed million times before, but let me clarify my needs:
I can see this topic has been brought up before but not answered successfully.
i know this topic has been discussed here before but i still can't get
This topic has been covered on this forums, but I haven't found a working
This topic has been scratched once or twice, but I am still puzzled. And
I know this topic has been discussed but I think it has some differences.
This is my first post. I know this topic has been discussed before in
This was an answer I got recently but the topic has died down and
I know this topic has been discussed to death, but there is one thing
I know this topic has been asked, but the posts are all out of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.