views:

1386

answers:

3

I would like to have a view (Hierarchy structure) under Navigation Controller (the top blue navigation bar) that has a TabBar (the black one in the bottom part) to show additional views (each for tab) at the same level.

If you select one of theese views (black tab bar) you should always have the TabBar visible to jump to another view of the same level. In case you want to go back to the upper hyerarchical level you have to select the "back" navigation button in the top bar (blue one) and the "tab bar" should disappear.

Why Apple suggests (it seems to me) to avoid that ?

I'm quoting from "View Controller Programming Guide for iPhone OS" page 39 where is written:

It’s very common to combine tab bar and navigation controllers, as illustrated in Figure 4. To do this, you simply add navigation controllers to a tab bar controller (however, you should never add a tab bar controller to a navigation controller).

Instead I would add a "Tab Bar" under a "Navigation bar" (the manager)

Do I think wrong ?

Thanks for your help !

Dario

+1  A: 

What they mean is that a tab bar should never be the child of a navigation view. The tab bar is really meant to define different "modes" of your application, while navigation controller's are to show hierarchal data.

If you want some kind of mode within a navigation controller, I think a toolbar tends to be used. For example the toolbar at the bottom in the Mail app.

UIToolbar Docs: http://bit.ly/rVjMV

criscokid
YEAH!! the toolbar (I forgot it !)Thanks
Fulkron
Don't forget the UISegmentedView. It's useful for mode-control, and can go anywhere on a page.
Amagrammer
A: 

What they mean is that navigation controller should never get pushed a tab bar view controller because it cannot support it, however a tabbarviewcontroller can support a navigation view controller so you can do it like that. You can also just add a tab bar to your navigation view controllers view (not the navigation stack) and have the navigation view manage the tab bar instead of the UITabBarViewController.

Daniel
+1  A: 

The following is correct according to what I have managed to dig on severals forums and documentations:

Tab Bar Controller > Navigation Controller > View

You do a lot just with the interface builder and then bind the TabBarItems, NavigationItems and Controllers to outlets in your code.

Some doc samples:
Building an iPhone App Combining Tab Bar, Navigation and Tab (YouTube)
iphonedevsdk (Forum)
Add NavigationController to TabBarController (Forum Tutorial)

Good luck, you can't do much if you stick to documentation. Visit forums and look for videos.

Maxime
The YouTube tutorial is exactly what I needed, thanks!
Alexandre L Telles