Reputation: 1318
So I recently set up an app with a navigation bar except it's refusing to stay in the middle of the screen. The title is moved slightly to the right and the right-most button is hidden off screen. I've tried everything from resizing, to deleting it and re adding it, to cleaning, etc... and nothing works. Any idea why this might be? :\
This is what it looks like when run on the simulator vs the Storyboard
Upvotes: 0
Views: 62
Reputation: 54600
The title is centered, but the UINavigationBar
is 600px wide. Your screen is not that wide. You need to add layout constraints that resize the toolbar appropriately for the containing view.
You need to add layout constraints. CTRL+DRAG from the UINavigationBar
to its parent view (in the left hierarchical tree-view tool window):
And add the following constraints (hold ALT and SHIFT while selecting):
Upvotes: 1