I have 6 view controllers on a UITabBarController. Each of them has a UINavigationBar at the top of them (Not linked to a UINavigationController), for showing the title of that view controller, and some buttons for controlling it. This was fine while I had 5 controllers, as no 'More' button would appear, but when I add a 6th, the more button appears. The tabs under that end up having two UINavigationBars! One is the one I added, with my title, the other is created by the TabBar and has a 'Back' arrow to go back to the more page. How can I fix this, either by merging them or otherwise?
Thanks, if you want screenshots just ask.
Here's a screenshot
The brown one is a UINavigationBar subclass I made, and added to the view in IB. The other one was added by the Tab Bar controller.
Yes you will need to merge them.As you need more tabs so More controller will apear and once you navigate in, it will put back button(more). In order to solve this and maintain your brown navigationBar
you will need to use navigationController
for those tabs
in more(only for extras, not for all). This will put more(the back button) on your navigationBar
.
But Remember In more
you will have edit
option also using which user can change position of tabs. So in that case this problem may reappear for other controllers. So please check if you can disable the editing of tabs
(rearrangement). If not then you should think the same for other controllers
also(in other tabs
)
Thanks,
Ok, Followed all of your tips but no luck, until: I tested this https://stackoverflow.com/a/3397506/468868
Basically, you are right @Ravin, we must wrap the items in NavigationControllers, but after that, you must specify that:
- (void)viewDidLoad
{
self.navigationController.navigationBarHidden = YES;
}
Now, I just need to figure it out how to remove the navigationController from the "More" view