Sliding TabBarController off screen when pushing new view on to navigationController
In apple's "TheElements" example projec开发者_如何学运维t, the tabBarController slides off screen with the rest of the view when pushing a view onto the tab button's navigation controller.
I cannot seem to see any code that specifically allows this??? But yet it happens..
Can someone point out what they are doing different?
From what I see: Create navigationControllers create views and push onto navigationControllers create tabbar and push navigation controllers as the tabBar's view array.
This is the conventional way to setup tab controllers but I cannot replicate the tab bar sliding off screen...
In general you can disable the TabBar when pushing controllers with hidesBottomBarWhenPushed
:
[myController setHidesBottomBarWhenPushed:YES];
[navController pushViewController:myController animated:YES];
Have a look at AtomicElementViewController.m, line 75:
self.hidesBottomBarWhenPushed = YES;
If you set this to NO, the tab bar will NOT be hidden, and will thus remain visible.
精彩评论