UITabBarController and only showing 1/2 of tab bar

Discussion in 'iOS Programming' started by skunkworker, Sep 25, 2009.

  1. skunkworker macrumors regular

    Joined:
    Sep 9, 2007
    #1
    I've got a tab bar and it properly switches between view controllers.
    But its only showing a half of the tab bar.
    [​IMG]
     
  2. drf1229 macrumors regular

    drf1229

    Joined:
    Jun 22, 2009
  3. neoserver macrumors 6502

    Joined:
    Apr 24, 2003
    #3
    You can try what was mentioned above, but how are you creating the UITabController? in IB or in code? If its in code, there is something incorrect when you're setting the frame.
     
  4. skunkworker thread starter macrumors regular

    Joined:
    Sep 9, 2007
    #4
    I'm creating it in code.
    Code:
     [self.view addSubview:tabBarController.view]; 
    But it seems like the view is not correctly sized as its getting pushed from another view.
     
  5. North Bronson macrumors 6502

    Joined:
    Oct 31, 2007
    Location:
    San José
    #5
    What is this view you are adding your tab bar controller's view to?

    Why don't you make your tab bar the "root" of your hierarchy?
     
  6. skunkworker thread starter macrumors regular

    Joined:
    Sep 9, 2007
    #6
    Cause my root view is a navigation controller.

    Its almost as if the navigation bar is pushing down the tabbarcontroller.
     
  7. Luke Redpath macrumors 6502a

    Joined:
    Nov 9, 2007
    Location:
    Colchester, UK
    #7
    You're not using the tab bar controller correctly. *It* should be your root view and your UINavigationController should be added as one of the view controllers for the tab bar controller (e.g. for the first tab).
     
  8. skunkworker thread starter macrumors regular

    Joined:
    Sep 9, 2007
    #8
    Well then i need to rethink how this particular part of my application operates.
     
  9. drf1229 macrumors regular

    drf1229

    Joined:
    Jun 22, 2009
    #9
    Just a suggestion:

    Instead of adding the tab bar controller in code, try making a hidden one in interface builder and when you want it to appear use this:
    Code:
     [TabBarControllerPointerName setHidden:NO];
     

Share This Page