robmathers
robmathers

Reputation: 3668

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?

Upvotes: 5

Views: 6656

Answers (2)

Rohit Mandiwal
Rohit Mandiwal

Reputation: 10462

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

enter image description here

Upvotes: 4

bilobatum
bilobatum

Reputation: 8918

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.

Upvotes: 13

Related Questions