No top navigation bar in tab bar controller app

I am new to programming on iphone and stumbled upon this problem which I think should be fairly simple.

I am using a tab bar application created from a template in Xcode IOS 5.1. It works fine and creates 3 screens in the storyboard (tablet panel controller + + 2 pull-down views), but when I try to add the top panel to these two views, the problem arises ...

I do this by adding the top navigation bar in the interface designer from the object inspector for the tab bar controller. After checking this option, the top panel is displayed perfectly in my storyboard for all three screens (tabbarcontroller + 2 descended views), but after starting the project the top navigation bar no longer exists.

What am I missing here? Why is there no top bar?

+5
source share
3 answers

If you want to display the navigation bar on two ViewControllersapplications based on the tab bar, you can do the following:

  • Delete viewcontroller1, then drag it ViewControllerinto the storyboard from the library and select it and go to the \ Embed In \ Navigation Controller editor.

  • In UITabBarControllerclick on the tab and right-click, select the link and drag it to the navigation controller. (means adding UINavigationControlleras a tab).

Hope this helps!

+17
source

By this way i integrate Navigation Bar to my viewController from tabBarController View

follow Nuzhat Zari to display the navigation bar on the viewcontrollers of your tabBar based application

+15
 self.tabBar.frame =CGRectMake(0,0,self.view.frame.size.width,50);

This will cause the tab bar to appear at the top of the controller.

0
source

All Articles