Search code examples
uikituinavigationcontrolleruisplitviewcontroller

Is it possible to hide the Nav Bar on a UISplitViewController?


I have a very simple app that I want to use a UISplitViewController in. It's so simple that I don't want the NavigationBar visible in portrait because there is no navigation in the left pane. (I do want to show it in portrait for the Popover to appear from. However, I don't seem able to hide it. Is the top element even a Nav Bar?

I've tried both of these:

[[splitViewController navigationController] setNavigationBarHidden:YES animated:NO];

for(UIViewController* vc in [splitViewController viewControllers]) {
    [[vc navigationController] setNavigationBarHidden:YES animated:NO];

}

But neither works.


Solution

  • you try this:

    source code: https://github.com/mattgemmell/MGSplitViewController/

    it helpful for hide the nav bar on a SplitViewController