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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T22:08:19+00:00 2026-05-23T22:08:19+00:00

I have a UITabBarController in my MainWindow.xib. Each tab contains a UINavigationController which has

  • 0

I have a UITabBarController in my MainWindow.xib.

Each tab contains a UINavigationController which has a UITableViewController.

When I press a button in the UITableViewController I want to push a view controller onto the navigation stack in horizontal orientation.

I have over-ridden the following in the UITableViewController

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    // Return YES for supported orientations.
    return YES;
}

but the pushed view controller does not appear in horizontal orientation (in the XIB it is defined as landscape).

How can I push it in horizontal orientation?

  • 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-23T22:08:19+00:00Added an answer on May 23, 2026 at 10:08 pm

    Autorotation for UITabBarController and UINavigationController has got some constraints:

    1. for UITabBarController, autorotation will work only if all of the controllers in the tab bar support autorotation;

    2. for UINavigationController, autorotation will work only if the rootViewController in the UINavigationController supports it.

    Once you have ensured that this conditions are met, then you can try and push your UITableViewController having defined its shouldAutorotateToInterfaceOrientation like this:

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

    EDIT:

    All of your UIViewControllers should have this definition for shouldAutorotateToInterfaceOrientation:

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

    except the one you want to force to landscape, which should have the definition given above.

    Also have a look at the last post in this thread to correctly implement shouldAutorotateToInterfaceOrientation for UITabBarController.

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

Sidebar

Related Questions

I have a UITabBarController interface with 4 tabs. Each tab has a UINavigationController .
I have four UINavigationControllers assigned each to a tab in a UITabBarController. Each UINavigationController
I have a UITabBarController that loads a UINavigationController for each of its tab. The
I have a UITabBarController as my MainWindow.xib . I have 3 tab bar items
I have a UITabBarController which has on one of its tabs, a UINavigationController. The
i have a uitabbarcontroller which has 3 items. each item has its own navigation
I have a UINavigationController inside a UITabBarController. When a user presses the first tab,
I have an uitabbarcontroller which contains a couple uiViewControllers. When i show one of
I have a UITabBarController that is loading a UINavigationController. When I push a new
I have an application that has a UITabBarController with two tabs, each having its

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.