Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hide Navigation Bar in Interface Builder w/ Storyboards

I have a pretty basic storyboard based app, with a UINavigationController, a main view and a secondary view, both of which are in the navigation hierarchy. I’m currently hiding the navigation bar on the main view by using setNavigationBarHidden: as appropriate in viewWillAppear and viewWillDisappear. It seems like there should be a way to do this in Interface Builder, rather than in code. Essentially I’d like the options available in the Simulated Metrics options, but not simulated. Does that exist?

like image 691
robmathers Avatar asked Sep 29 '13 21:09

robmathers


People also ask

How to hide the navigation bar in a window?

You can hide the navigation bar using the SYSTEM_UI_FLAG_HIDE_NAVIGATION flag. This snippet hides both the navigation bar and the status bar: window.decorView.apply { // Hide both the navigation bar and the status bar.

How do I make content appear behind the navigation bar?

Make Content Appear Behind the Navigation Bar. On Android 4.1 and higher, you can set your application's content to appear behind the navigation bar, so that the content doesn't resize as the navigation bar hides and shows. To do this, use SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION.

What is the difference between Table View and storyboard in iOS?

Usually table view and navigation controller work hand in hand for most of the apps. This doesn’t mean you have to use both together, however. Storyboard, as mentioned earlier, is a new feature available since the release of Xcode 4.2. It offers a complete new way for iOS developer to create and design user interface.

How to embed a navigation controller in Xcode?

By default, Xcode creates a standard view controller. As we’ll use navigation controller to control the screen navigation, we first change the view controller to navigation controller. Select the Simply select “Editor” in the menu and select “Embed in”, followed by “Navigation Controller”.


2 Answers

In the scene for the UINavigationController itself, I suppose you could check the hidden button for the nav bar in the Attributes inspector, but that would make the nav bar hidden for all the view controllers in the navigation stack. But that's not what you want.

To hide the nav bar for an individual view controller using IB, you would need to use a stand alone nav bar for each view controller (e.g., drap and drop a Navigation Bar from the object library in IB). To use a stand alone nav bar in a navigation stack would be more work than programmatically hiding the nav bar.

like image 150
bilobatum Avatar answered Sep 27 '22 22:09

bilobatum


Just uncheck the Attribute Inspector > Shows Navigation Bar in Attribute Inspector

enter image description here

like image 36
Rohit Mandiwal Avatar answered Sep 27 '22 20:09

Rohit Mandiwal