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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T00:56:36+00:00 2026-05-16T00:56:36+00:00

i have some Problems with my iPad Code. I have a UITabBarController which holds

  • 0

i have some Problems with my iPad Code.

I have a UITabBarController which holds some UIViewController and a UISplitViewController. The problem is that the UIViewController and even the UISplitViewController dont recognize orientation Changes correctly.

i have set shouldAutorotateToInterfaceOrientation on my TabBarController and all UIViewControllers but i realized that only willRotateToInterfaceOrientation in the Top moast ViewController will fire which is my TabBarController. If i remove shouldAutorotateToInterfaceOrientation from my TabBarController willRotateToInterfaceOrientation from my sub UIViewControllers will get called. The biggest problem is my UISplitViewController, because it will rotate to the new interfaceOrientation but it is stucked in his Portrait Layout.

How do i correctly implement a TabBarController with ViewControllers and Splitviews including orientation changes?

  • 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-16T00:56:36+00:00Added an answer on May 16, 2026 at 12:56 am

    Hey i came up with a Workaround myself now.
    To Recap the Problem Only the first addet View to the Window will recognize Orientation Changes.

    I Subclassed My TabBarController and made it ro Rotate to the Interface Orientation

    - (void) willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration {
        [self adjustViewsForOrientation:toInterfaceOrientation];    
    }
    
    - (void) adjustViewsForOrientation:(UIInterfaceOrientation)orientation {
        if (orientation == UIInterfaceOrientationLandscapeLeft || orientation == UIInterfaceOrientationLandscapeRight) {
            NSLog(@"Landscape");
            //Do Your Landscape Changes here
    
    
        }
        else if (orientation == UIInterfaceOrientationPortrait || orientation == UIInterfaceOrientationPortraitUpsideDown) {
            NSLog(@"Portrait");
            //Do Your Portrait Changes here
        }
    }
    

    But now the “viewControllers” of my TabBarController wont still recognize my InterfaceOrientations. So i came up with The folowing:

    - (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation {
        for (int i = 0; i < [self.viewControllers count]; i++ ) {
            [[self.viewControllers objectAtIndex:i] didRotateFromInterfaceOrientation:fromInterfaceOrientation];
        }
    }
    

    This will call the didRotateFromInterfaceOrientation Method from all Subclasses of the TabBarController:

    - (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation{
        [self adjustViewsForOrientation:self.interfaceOrientation];
    }
    
    - (void) adjustViewsForOrientation:(UIInterfaceOrientation)orientation {
        if (orientation == UIInterfaceOrientationLandscapeLeft || orientation == UIInterfaceOrientationLandscapeRight) {
            NSLog(@"Subview Landscape");
            //Do Your Landscape Changes here
        }
        else if (orientation == UIInterfaceOrientationPortrait || orientation == UIInterfaceOrientationPortraitUpsideDown) {
            NSLog(@"Subview Portrait");
            //Do Your Portrait Changes here
        }
    }
    

    As You can see i call [self adjustViewsForOrientation:self.interfaceOrientation]; in my Sub Viewcontroller which will give the actuall Orientation to the adjust method. If you use fromInterfaceOrientation it will be the wrong Orientation, because the change was already done!

    My other problem was the UISplitviewController in TabBarController, but i dident got it working in a acceptable way. The problem is the same as for the UIViewControllers. It wont regocnize Orientation Changes so you have to Subclass it, but i dident get it working to 100%. As i searched the Web i found a good Code Example for a cutsom build Splitview. So ull maybe give it a shot:
    http://blog.trustedones.com/development/ipad-uisplitviewcontroller-replacement-for-sethidesmasterviewinportrait
    http://www.trustedones.com/apps/ipad

    It also keeps the SplitView in Portrait Mode so you maybe will like it. I do!

    Hope i could help someone with this post..
    Cheers
    nettz

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

Sidebar

Related Questions

I am developing an app for iphone/ipad that I have some problems with. I
I have some sort of problem, when it comes to customizing the iPad-launch-lcreens of
i have some problems with a Query seem IN dosen't work with Group_concat, that
I have some problems with Javascript. In fact, I'm just newbie in that script
I've got an interesting problem. I have an iPad App which has to parse
I have some code that returns a struct containing 2 objects (declared as id
I have some weird behavior on the iPad that I am not getting on
The Problem I have a UIWebView inside my iPad application which I need to
Hi have some problem with compiling GameKit framework on iPad , when xcode compiles
I have some problems with header() function. It works and doesn't work at the

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.