The UINavigationController Back button is not visible, but it works

I have a scenario where my UINavigationController skips the return button (left button), but pressing the left button still works.

I found a similar problem posted here: Does the UINavigationController return button disappear? which was resolved without setting the title to @ "", but that is not my problem. Are there other scenarios that can cause this behavior?

UPDATE:

In case that matters, this is my view hierarchy. My MainWindow contains a UINavigationView, which first loads the UIViewController (this view contains a map). When you click on the accessory annotation button, the UITableViewController is loaded. This is the view that the back button should have.

Thanks.

+7
iphone uinavigationcontroller
source share
3 answers

Oh dude! Well, I found the answer in an article on iphonedevsdk.com, now non-existent.

It turns out that my first view (the one on which there is a map) did not have a set of headings (in fact, I hide the navigation bar because I did not want to show it). Even if the header was set in a later view, the SDK does not seem to care. I still don't understand 100% why I can click on an area to make it work.

Therefore, although I am hiding the first navigation bar, I still need to set its title.

It did it!

Thanks to everyone who tried to help.

+14
source share

In addition to the proposals presented above. Changing the appearance of the navigation bar can also make the Back button invisible.

UINavigationBar.appearance().tintColor = UIColor.white

Make sure that you do not set this hue color to something that matches the background.

+1
source share

Are you overriding the back button element - not the same as the left button - anywhere in your code? i.e:.

 self.navigationItem.backBarButtonItem = ... 

Do you set the hidesBackButton property anywhere? i.e:.

 self.navigationItem.hidesBackButton = YES; 
0
source share

All Articles