Jayson Tamayo
Jayson Tamayo

Reputation: 2811

Bar Button Item is not Showing

I am trying to create a bottom toolbar. So I dragged I Bar Button Item to the View Controller and it was automatically position at the bottom, see image below:

enter image description here

But when I run the app, it doesn't show the bar at the bottom. enter image description here

I already added:self.navigationController?.navigationBarHidden = false

Upvotes: 3

Views: 10152

Answers (6)

Ravi
Ravi

Reputation: 1

Sometimes bar button item and bar button do not show when we present our screen. On screen we can then not see bar button item and bar button. So we need to push our screen if we want bar button item and rightBarButtonItem.

Upvotes: -3

saswanb
saswanb

Reputation: 1985

The navigation bar and the toolbar are two different things and the toolbar is hidden by default. Try setting the toolbar hidden attribute to false.

Upvotes: 0

Badal Shah
Badal Shah

Reputation: 7602

Drag UIToolbar controller directly instead of only UIBarbutton item.

enter image description here

Upvotes: 2

Alessandro Ornano
Alessandro Ornano

Reputation: 35392

I think it's just only a constraints problem. First of all check your Document Outline near to the left of your table, to see the position (toolbar is just below table):

enter image description here

Add your constraints and pay attention to all options as shown in the picture:

enter image description here

Then, take a look to the size inspector, for the table view:

enter image description here

And for the toolbar:

enter image description here

This configuration working both in portrait/landscape mode.

Upvotes: 6

woogii
woogii

Reputation: 413

Have you set constraints of UIToolbar? I just guess it can be one of the reasons why you cannot see your barbuttoitem.

Upvotes: 0

Yagnesh Dobariya
Yagnesh Dobariya

Reputation: 2251

self.navigationController?.navigationBar.hidden=false

Upvotes: 0

Related Questions