Mirr
Mirr

Reputation: 131

Xcode simulator - Navigation bar is missing

I don't know why but my navigation bar is missing from my ios simulation.

Anybody know where might be the problem?

Yes I have "Shows Navigation bar" and I don't have any warnings.

I wanted to try "Update frames" but I don't have this option available.

I am using Xcode 7.3 and Swift.

Thank you

enter image description here

Upvotes: 3

Views: 4326

Answers (5)

Steve W.
Steve W.

Reputation: 81

I had the same problem: the navigation bar was showing on the root view in Storyboard, but when running the Simulator - there was no navigation bar at the top of the views. This solved it:

Navigation Controller > Navigation Bar > UNCHECK Translucent (it is checked by default). This did two things:

  1. My Navigation Bar shows on all subsequent views.
  2. The topmost subview on subsequent views is now at Y=0, and not Y=64.

enter image description here

Upvotes: 0

Alessandro Ornano
Alessandro Ornano

Reputation: 35392

You can solve by embedding a navigation controller:

enter image description here

Upvotes: 4

Badal Shah
Badal Shah

Reputation: 7602

There are two possibilities.

1) May be you didn't Embeded navigationcontroller before your viewcontroller. so, add Navigation controller with go to

Editor -> Embededin -> Navigation controller.

enter image description here

enter image description here

2) If you have add navigation controller but May be you have set NONE as topbar of Viewcontroller.

enter image description here

Upvotes: -1

Jay Bhadja
Jay Bhadja

Reputation: 30

Its depend how to embedding navigation controller but you can try to embedding navigation controller following below way and than run application and check in simulator : Go to Editor in xcode -> Embed in -> Navigation Controller.

Upvotes: 0

mokagio
mokagio

Reputation: 17481

As other people have said in the comments without showing some code or screenshot of IB it's hard to find out where the problem is... But here's some things to checkout.

Are you sure your view controller is embedded in a UINavigationController?

If you are using Storyboards you should have something like this:

enter image description here

In code instead you might have set the window.rootViewController property in the AppDelegate to the content view controller rather than the navigation controller which is supposed to contain it.

Upvotes: 1

Related Questions