Embedding a UITabController within a UINavigationController

Discussion in 'iOS Programming' started by blueeye, Oct 7, 2009.

  1. blueeye macrumors member

    blueeye

    Joined:
    Oct 27, 2007
    #1
    Hi,

    I've been trying to create an application which uses a navigation controller to select a "person" and then uses a tab controller to allow you to select different "tabs" of information.
    I can get this to work, but for one annoyance: The bottom of the tabs is below the level of the screen and the views are not being properly resized.
    I've attached screenshots of everything just to help anyone to understand the problem.
    I've searched around but can't find anything. Any help would be much appreciated.
     

    Attached Files:

  2. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #2
    Doesn't look like your tab bar controller view is taking into account the screen space needed for the navigation bar.
     
  3. blueeye thread starter macrumors member

    blueeye

    Joined:
    Oct 27, 2007
    #3
    ... I realise that, I'm trying to fix it...
     
  4. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #4
    You're not being short with me, are you? :confused:
     
  5. blueeye thread starter macrumors member

    blueeye

    Joined:
    Oct 27, 2007
    #5
    I wouldn't dream of it.
    Maybe a little because I know what's going on, but I don't really know why. They why is where I need to go before I can find the how of fixing it.:apple:
     
  6. blueeye thread starter macrumors member

    blueeye

    Joined:
    Oct 27, 2007
    #6
    Okay, in case this helps anyone understand the problem better than I do (because I don't understand it at all):

    I tried removing the navigation bar at the top of the navigation controller, but it made no difference. Either that space is reserved for such anyway, or something is funny with the UITabController.
    I also tried resizing the UITabController's view but I couldn't find a way to do it (well, one that worked). Most of what I tried to do was make it autoresize via Interface Builder. Needless to say, attempts failed.
    The whole tab business has been a bit dodgy from the way it's "resized" the tabbed views to it's own quite obvious problem so I wonder if maybe there's a better way of incorporating it into the navigation controller? I considered using modal views but am not sure if that will help. Can anyone shed any light on this?
     
  7. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #7
    Did you try adding a Navigation Bar as the Top Bar in the Simulated Interface Elements section for your Tab Bar Controller?
     
  8. blueeye thread starter macrumors member

    blueeye

    Joined:
    Oct 27, 2007
    #8
    I just tried to do it now but although Interface gave me the option, if I tried to set it as such it immediately switched back. Maybe such an attempt is disallowed?
     

Share This Page