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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T11:25:28+00:00 2026-05-20T11:25:28+00:00

I have an iPhone application that’s using Navigation Controller to display the top bar

  • 0

I have an iPhone application that’s using Navigation Controller to display the top bar (with title and back button, and such…).

I added a UITabBar to the application window, that enables to switch between the parts of it. Instead of adding the tab bar to each of ViewController’s view I added the bar to app window.

(When I had it in the ViewController, switching between controllers made the tab bar to swipe left/right, when animated pop/push occured, together with whole view).

So, I added the UITabBar to the MainWindow.xib, and tied it to the app delegate’s variable. In my didFinishLaunchingWithOptions method, I added the following code:

[self.window addSubview:navigationController.view];

CGRect frame = navigationController.view.frame;
frame.size.height -= tabbar.frame.size.height;
navigationController.view.frame = frame;
tabbar.selectedItem = [tabbar.items objectAtIndex:0];

to resize the main (navigationController‘s) view, in order to make the TabBar visible.

The problem shows up when I rotate the device — my view gets stretched to full window and I loose the ability to show the TabBar.

I added a - (void) didRotateFromInterfaceOrientation:(UIInterfaceOrientation) fromInterfaceOrientation method to my ViewController, with the following code:

- (void) didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation {
    CGRect frame = self.view.frame;
    frame.size.height -= [AppState shared].tabBar.frame.size.height;
    //frame.origin.y = [AppState shared].tabBar.frame.size.height;
    //frame.origin.x = 100;
    self.view.frame = frame;    
    frame = [AppState shared].tabBar.frame;
    frame.origin.y = [UIScreen mainScreen].bounds.size.height - frame.origin.y - frame.size.height;
    [AppState shared].tabBar.frame = frame;
}

It resizes the view, and moves the tab bar to up/down part of the view (I allow only Portrait/Portrait upside down orientations here). The problem is, my TabBar is turned upside down as well, and also, it’s no longer clickable.

It looks like the image below:

Tab bar upside down

Anyone knows how to handle this kind of situation? Or, how to make the tab bar not tied to view controller, but also able to handle interface’s rotation smoothly?

  • 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-20T11:25:29+00:00Added an answer on May 20, 2026 at 11:25 am

    You are using the tabbar in an unintended way. You seem to be using the UITabBarView as an uncontrolled element of other views. That is not it’s function.

    The UITabBarView should be controlled directly by a UITabBarController which in turn should be controlling all the view controllers for the views displayed in the tabbar i.e. the tabbar controller is a type of navigation controller that controls subcontrollers.

    Suppose you have three tabs and the third one is a navigation controller. Your controller hierarchy would look like this:

    TabbarController:
        -->tab1ViewController
        -->tab2ViewController
        -->tab3ViewController(UINavigationController):
                -->rootViewController-->secondViewController
    

    You are trying to move and manage the tabbar view without its controller and the proper controller hierarchy. That isn’t going to work.

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

Sidebar

Related Questions

I have an iPhone application with a settings.bundle that handles various settings for my
I have an application that works some what similar to how iPhone's Contact application
I have created an iPhone application based on an OpenGL view. Now I would
I have worked on iPhone application but not aware of the formalities to submit
In my iPhone application I have a table view. When user taps any row,
I have a webview in my iPhone application, and I also have some html
Does anyone have any suggestions as to how to version an iphone application aside
I have two projects, a Cocoa iPhone application and a static library which it
I have included <zlib.h> in my iphone application and the source code I was
AVFoundation.framework is not where the documentation says it should be. I have iPhone SDK

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.