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 7948229
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T01:39:53+00:00 2026-06-04T01:39:53+00:00

While, for the most part, orientation is working properly for my app, I’m having

  • 0

While, for the most part, orientation is working properly for my app, I’m having an issue testing on my iPad 1. If I have the device tipped at a relatively low angle, there are times while navigating through the tabs that the tab bar appears in landscape mode, but the page calls a portrait mode uiview and then tries to render it in landscape mode, screwing up my UI.

I’m trying to figure out if there is a method to lock down “if the tab bar appears in landscape mode, always call the landscape UIViews and if in portrait mode, always call the portrait UIView.”

On each view controller I’ve set the following:

- (void)viewDidLoad
{
[super viewDidLoad];

// iPad-specific condition here
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
{
    if (UIDeviceOrientationIsPortrait([UIDevice currentDevice].orientation)){
        self.view = self.portraitViewiPad;
    }
    else {
        self.view = self.landscapeViewiPad;
    }
}
}

-(void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration {

// iPad-specific condition here
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
{
    if (toInterfaceOrientation == UIInterfaceOrientationPortrait || toInterfaceOrientation == UIInterfaceOrientationPortraitUpsideDown) {

        //show portrait XIB here
        self.view = self.portraitViewiPad;

    } else {

        //show landscape XIB here
        self.view = self.landscapeViewiPad;

    }
}
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
    {
    // iPad-specific interface here
    return YES;
}
else
{
    // For iPhone and iPod touch interface
    return (interfaceOrientation == UIInterfaceOrientationPortrait);

}
}

I’ve also adjusted the app delegate using the method below thinking that could address the issue:

- (void)tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController{
//CALLS RELOAD METHODS HERE AND EACH UIVIEW IS PROPERLY BEING CALLED
}

UPDATE:

Corrected this issue by checking the orientation of the status bar and displaying the correct uiview accordingly. Here’s how I updated my viewDidLoad methods:

if ([[UIApplication sharedApplication] statusBarOrientation] == UIDeviceOrientationLandscapeLeft){

    NSLog(@"Left landscape detected");

    self.view = self.landscapeViewiPad;


} else if ([[UIApplication sharedApplication] statusBarOrientation] == UIDeviceOrientationLandscapeRight){

    NSLog(@"Right landscape detected");

    self.view = self.landscapeViewiPad;

} else if ([[UIApplication sharedApplication] statusBarOrientation] == UIDeviceOrientationPortrait){

    NSLog(@"Portrait orientation detected");

    self.view = self.portraitViewiPad;

} else if ([[UIApplication sharedApplication] statusBarOrientation] == UIDeviceOrientationPortraitUpsideDown){

    NSLog(@"Upsidedown Portrait detected");

    self.view = self.portraitViewiPad;

}
  • 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-04T01:39:55+00:00Added an answer on June 4, 2026 at 1:39 am

    I think that you don’t want to do test [[UIDevice currentDevice] orientation]. As the documentation notes that value can be different than the actual orientation of your app’s UI. I think you’ll want to rely on the calls to [UIViewController shouldRotateTo…] and [UIViewController willRotateTo…].

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

Sidebar

Related Questions

been working with symfony for a while. most tutorials describe having multiple actions in
I have a minor issue with displaying TextViews in my app while running on
While reset and checkout have different usages most of the time, I can't see
I have been using sbt and sbt-idea for a while and for the most
While for the most part you can generate the same MSIL, there are definitely
I have some code that needs Unicode strings for the most part, but I
I have created a VB.NET 2008 Class Library that has, for the most part,
While most questions are about grouping nodes based on similarity (pidgeonholes), I would like
While trying to answer this question I found without () (which invokes C++ most
Most popular browsers, while rendering an image, they display it line-by-line top-to-bottom as it

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.