0

I am trying to create a view with a TableView in the center, NavigationBar on top, and a TabBar with 5 items. The TabBarItems will be attached to 5 different modal views. And the tableview can select an item and "navigate" to another tableview or detail view.

Following the Apple doc, I tried to create a NavigationController in a TabBarController in IB, but failed. I read all the posting regarding to this topic, and they all described a NavigationController inside one of the TabBarItem. But that is not what I want. The TabBarController and NavigationController are separate controller doing separate thing in the same view.

So I start wondering maybe it is a design issue. I should just use a NavigationController and add the TabBar as objects and not controller in the view.

Am I going the right track or is there a better way to combine NavigationController and TabBarController in IB to do the job that I want. Am I making sense?

1 Answer 1

0

If the tab bar is actually being used as a tab bar, it sounds like you want 5 navigation controllers, one for each tab.

If the tab bar is being used as a toolbar to hold buttons that bring up modal view controllers, push views onto the navigation controller, or other actions besides what a tab bar is intended for, use a UIToolbar instead. UINavigationController actually has toolbar support built in, just set its toolbarHidden property to NO and set the toolbarItems property on each view controller that can go inside the navigation controller to an array of appropriate UIBarButtonItems.

2
  • Ah, so I did design it wrong. I don't want 5 navigation controllers. But is it ok to use the TabBar? Because I do like the TabBar look more than the toolbar... I hope there is nothing in Apple's HIG for that. Thanks!!
    – Spock
    Mar 18, 2011 at 4:57
  • The HIG does say not to use a tab bar for controls that act on the current screen, and they have a blanket statement that controls should "behave as they do in [Apple's] applications".
    – Anomie
    Mar 18, 2011 at 11:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.