12

I'm woking on a simple iphone application. The applicaton has a table view on first screen. If the user clicks on an item on that table view, application navigates to the second view. The second view has a table view, too. If the user clicks on an item on this screen, I want to show a new xib which has Tab Bar Controller.

Actually, I did it. But, the problem is that I can't see the tabs. The tabs are shown at the bottom, outside of the screen. How can I solve this problem?

Thanks.

Murat
  • 878
  • 3
  • 11
  • 19

3 Answers3

14

Here is an tutorial that I was able to get working.

I also read the official SDK documentation on the topic: Combining Tab Bar and Navigation Controllers. Since I'm still learning, the tutorial helped me more than the docs.

NOTE: in the tutorial, i don't think you need to subclass UINavigationController, and I'm experimenting with this idea now.

UPDATE: I was able to get the tutorial working without subclassing UINavigationController. So a subclass is not required.

Jeff Atwood
  • 63,320
  • 48
  • 150
  • 153
bentford
  • 33,038
  • 7
  • 61
  • 57
  • 2
    I answered this when I was very new to iPhone. Glad it still helped. – bentford Jun 23 '11 at 18:48
  • 2
    The URL's are all dead now, is there a way you can update them? – Rob Apr 04 '13 at 14:41
  • Hmm yes, the links are dead and Apple has no replacement for this section in the docs. I will re-answer the question with code sample. – bentford Apr 04 '13 at 19:36
  • 2
    all links are dead but this one might work: https://developer.apple.com/library/ios/#documentation/WindowsViews/Conceptual/ViewControllerCatalog/Chapters/CombiningViewControllers.html – godzilla Aug 05 '13 at 19:53
1

Open Interface Builder.

Click a tab and check whether sub-controller(of tabbar controller) is UIViewController or UINavigationController. (Default: UIViewController)

If UIViewController, replace it with UINavagationController.

And Set the root view controller of UINavigationController to first view controller.

Last, call pushViewController method, not presentModalViewController method.

ChangUZ
  • 5,380
  • 10
  • 46
  • 64
-1

TabBar HAS to be the root controller, add navControllers in the tab items as needed and hide the tabBar at the beginning of the App, to show it when you want it to appear.

Wytchkraft
  • 77
  • 2
  • 8