开发者

UINavigationBar back button does not appear

开发者 https://www.devze.com 2023-02-09 11:28 出处:网络
I have a navigationBar, with a UIImage on it\'s title, like this: self.navigationItem.titleView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@\"top_logo.png\"]];

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 d开发者_JAVA百科on't understand why...

Thanks,

RL


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).


did you push the new view through the navigation stack?

like:

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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号