Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UINavigationBar back button does not appear

I have a navigationBar, with a UIImage on it's title, like this:

self.navigationItem.titleView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"top_logo.png"]];

When i select a row, the "back" button does not appear. Why?

I have the exact same code on other's viewControllers, and it appears. I don't understand why...

Thanks,

RL

like image 722
Rui Lopes Avatar asked Jan 20 '23 13:01

Rui Lopes


1 Answers

The back button won't appear unless you've set self.navigationItem.title or 'self.title' in the previous view controller on the stack (parent VC) or explicitly created a UIBarButtonItem and set it to self.navigationItem.backBarButtonItem in the previous view controller on the stack (parent VC).

like image 124
benwong Avatar answered Jan 31 '23 16:01

benwong