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

  • SEARCH
  • Home
  • 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 3280814
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T19:44:48+00:00 2026-05-17T19:44:48+00:00

This is just a test application, There is only a AppDelegate class to create

  • 0

This is just a test application, There is only a AppDelegate class to create all I did was create a Window based app, set the supported orientations to only the landscape in the info.plist, and then add the following code:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {    
[application setStatusBarOrientation:UIInterfaceOrientationLandscapeLeft];

// Override point for customization after application launch.
UIAlertView *test = [[UIAlertView alloc] initWithTitle:@"hu" message:@"hui" delegate:nil cancelButtonTitle:@"hi" otherButtonTitles:nil];
[test show];
[window makeKeyAndVisible];
    NSLog(@"win %f - %f", window.bounds.size.width, window.bounds.size.height);
return YES;
}

Without the first line, which sets the status bar orientation, the alert view appears in portrait even though the rest of the interface is in landscape left.

Anyway the Log still gives this:

win 768.000000 - 1024.000000

This is the wrong way round (and thus when I add subviews in my real app the frames are not correct)

Apple seems to have really mucked up on the interface rotation, because I’ve had nothing but problems, I don’t remember any of this happening on the iPhone, so please can someone tell me how to fix this.

I’ll give 500 reputation (that’s all but 10 of my reputation) to the person who can at least explain why this happens and hopefully provide a solution.

  • 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-05-17T19:44:48+00:00Added an answer on May 17, 2026 at 7:44 pm

    I think the “Launching in Landscape Mode” of the iOS Application Programming Guide mostly explains what is happening with your test application:

    Applications in iOS 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 mode, 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.

    Important: The preceding steps assume
    your application uses view controllers
    to manage its view hierarchy. View
    controllers provide a significant
    amount of infrastructure for handling
    orientation changes as well as other
    complex view-related events. If your
    application is not using view
    controllers—as may be the case with
    games and other OpenGL ES–based
    applications—you are responsible for
    rotating the drawing surface (or
    adjusting your drawing commands) as
    needed to present your content in
    landscape mode.

    In terms of your test application, the key part is the last section. You do not have a view controller, so you are entirely responsible for setting up the UI in the orientation you want. That is why you have to set the status bar orientation manually.

    I read the first paragraph as saying that iOS apps always launch in portrait mode and then the root view controller rotates its view to match the device orientation immediately and without animation once it is added to the window. That means the UIWindow itself does not rotate so its dimensions will always be in terms of a portrait orientation (as tadej5553 has said). In addition, the frames of all of the UIWindow subviews will also be in terms of a portrait orientation (since the frame is always defined in the parent view’s coordinates). So, no matter how you rotate the device, the root view controller’s frame will always be in terms of a portrait orientation. However, since a view’s bounds property is defined in terms of its own coordinates, that height and width should reflect the current orientation of the view.

    It is not clear what you are trying to accomplish with your real app, but the recommended practice is to lay out your views for portrait orientation and then set their autoresizing properties to handle the automatic rotation (whether it occur immediately after app launch or later).

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

Sidebar

Related Questions

How would you test this scenario? I've just started looking into NHibernate and having
How do I setup a class that represents an interface? Is this just an
This error just started popping up all over our site. Permission denied to call
This is just to satisfy my own curiosity. Is there an implementation of this:
I'm attempting to build a window-based application system (a mini GUI, if you will)
This just won't work. The problem is that I do not know enough to
This is just a general question - I was sitting and waiting for a
This is just a question to satisfy my curiosity. But to me it is
This works just fine: protected void txtTest_Load(object sender, EventArgs e) { if (sender is
This is just a question to help me understand CSS rendering better. Lets say

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.