Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to hide UITabBar when a collapsed UISplitViewController shows a Detail ViewController?

I have a window with a UITabBarController as rootViewController. The UITabBarController has two children: A UINavigationController and a UISplitViewController (according to the latest docs this should be OK, and it works except for the following problem).

Both the UINavigationController as well as the UISplitViewController show a MyMasterTableViewController which can push instances of MyDetailViewController. MyDetailViewController has self.hidesBottomBarWhenPushed = YES to make the TabBar disappear on push.

When I push MyDetailViewController onto the UINavigationController the UITabBar disappears as expected. When I show MyDetailViewController on the UISplitViewController while it is collapsed, I would expect the same, since the collapsed UISplitViewController contains only a UINavigationController with the Master which pushes the Detail ViewController. It doesn't however.

How can I let a collapsed UISplitViewController make the UITabBar hide on showing MyDetailViewController like the UINavigationController does?

like image 251
Stefan Avatar asked Nov 10 '22 05:11

Stefan


1 Answers

Unfortunately you cannot take advantage of Hide Bottom Bar on Push while using a UISplitViewController inside a UITabBarController. You can override the UITabBarController viewControllers and for the iPhone only, point to the MasterViewController's UINavigationController in the Storyboard. This is where you can Hide Bottom Bar on Push. The UISplitViewController for some reason does not respect the flag on a push, probably for iPad purposes.enter image description here

like image 182
rmurdoch Avatar answered Nov 15 '22 04:11

rmurdoch