Reputation: 44352
I have a ViewController. There is a NavigationController in the app. When I drag a Bar Button Item to the navigation bar, the item usually goes to the bottom of the ViewController. Although in the past, I have managed to get it to stick to the top right, where it is supposed to go.
Any idea why this sometimes works and sometimes not? Also, why does it go to the bottom? Going to the bottom does not follow the HIGs.
Upvotes: 3
Views: 875
Reputation: 21
If that doesn't work, select root view controller->Attributes Inspector->Top Bar -> Opaque Navigation Bar. Tested and worked. Xcode7
Upvotes: 1
Reputation: 12373
I faced the same issue too. The fix is, Select the Navigation Controller.( the border of the controller changes to blue) In the right menu, select 'Attributes Inspector' You should see a 'Top Bar' menu item. Select 'Opaque Navigation Bar' in the dropdown Now add the bar button item to the top right/left navigation bar, it should work.
Tested and works in xcode 7
Upvotes: 2
Reputation: 15784
Besure that your ViewController is under a NavigationViewController.
Then, you have to insert first a Navigation Item into your Navigation Bar then add your BarButtonItem. I see that in Interface Builder, we can add only 1 BarButtonItem on the left and 1 BarButtonItem on the right.
Upvotes: 4