I've a problem with something that seems to be very simple. My app has a view hierarchy consisting in a UITabBarController containing UINavigationControllers. When I navigate from the root to the second level I set the hidesBottomBarWhenPushed on true so that the tab bar is hidden
On my firstLevelController:
[secondLevelController setHidesBottomBarWhenPushed:YES];
[self.navigationController pushViewController:secondLevelController animated:YES];
After that when I push to the third level, I bring the tab bar again by doing in the secondLevelController:
[self setHidesBottomBarWhenPushed:NO];
[thirdLevelController setHidesBottomBarWhenPushed:NO];
[self.navigationController pushViewController:thirdLevelController animated:YES];
(I know, I didn't like the [self setHidesBottomBarWhenPushed:NO]
either, but it didn´t work otherwise...)
So, here is the problem: when I push the back button in the third level and the second view appears, I need to hide the tabbar again but I couldn´t find the way of doing this.
Any help is appreciated
On your secondViewController, do :
This way, the tabbar will always be hidden when you are on the secondViewController, and it will appear on the other view controllers
I was actually on the same problem. I always tried to hide the tabbar when selecting a row and to disable hiding after returning to the list (a tableview inside a navigationcontroller) so that the user can select the menu again. I set the tabbarcontroller hidden inside the method
but when I hided it inside this method, the Tabbar was still hided when returning to my list again. Now I hide the Tabbarcontroller inside the init method of a specific viewcontroller, maybe this works for somebody else too:
now when i select a list item and this viewcontroller will be presented the tabbar is hided, after returning to the list it appears again.
This is what works for me.
The thirdlevelController shows the tabbar and secondLevelController does not show the tabbar when you pop the thirdLevelController.
You can try this
You declare in the secondLevelController
In the viewDidLoad,
I hope it could help you.
You can hold a bool value to understand if you are coming from a popViewController and in viewDidAppear you can detect it an hide your tab bar again.
}