user3049046
user3049046

Reputation: 21

UINavigationBar not appearing

The UINavigationBar from self.navigationController does not appear. I set the top bar in the IB to 'Black Navigation Bar', it shows on the IB but still not appear on the device.

Upvotes: 2

Views: 2461

Answers (2)

Isuru
Isuru

Reputation: 31323

Setting the top bar from the IB is only for visual purposes just so you know how to place other UI elements on the view controller. To set a navigation bar, either you have to drag it from the objects palette and place it in the view controller. Or embed your view controller in a UINavigationController.

Upvotes: 0

Thomas Keuleers
Thomas Keuleers

Reputation: 6115

Are you using a storyboard? Then the navigationbar isn't showing because your rootviewcontroller isn't wrapped in a navigationcontroller

You can fix this by selecting the viewcontroller in your storybard, then press "Editor > Embed In > Navigation Controller"

Upvotes: 4

Related Questions