UINavigationBar return button does not appear

I have a navigationBar, with a UIImage above this name, for example:

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

When I select a line, the back button does not appear. Why?

I have the same code on other viewControllers and it appears. I do not understand why...

Thank,

RL

+3
source share
2 answers

The "Back" button will not appear if you did not set self.navigationItem.titleeither "self.title" in the previous view controller on the stack (parent VC) or explicitly created it UIBarButtonItemand set it on self.navigationItem.backBarButtonItemthe previous view controller on the stack (parent VC).

+9
source

Have you clicked a new view through the navigation stack?

as:

[self.navigationController pushViewController:viewControllerToPush animated:YES];

0

Source: https://habr.com/ru/post/1790329/


All Articles