UINavigationController的后退按钮消失? [英] UINavigationController's back button disappears?

查看:167
本文介绍了UINavigationController的后退按钮消失?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我注意到我的一个视图控制器奇怪的事情:后退按钮消失,但它可以通过点击左上角(即按钮应该在哪里)回到上一个视图控制器。



在我的整个文件中没有行将self.navigationItem.hidesBackButton设置为YES; NSLog还会将0作为self.navigationItem.hidesBackButton在viewDidLoad中的值。



这在模拟器和真实设备中都会发生。任何想法?

解决方案

哦亲爱的。在上一个视图控制器的实现中,我不小心将self.title设置为@,这会导致这个恼人的错误。



删除此行解决问题。 p>

I notice something strange happens to one of my view controller: the back button disappears, yet it's possible to go back to previous view controller by tapping the top left corner (i.e where the button should reside).

In my entire file there's no line that set self.navigationItem.hidesBackButton to YES; also NSLog prints 0 as self.navigationItem.hidesBackButton's value in viewDidLoad.

This occurs in both the simulator and real device. Any ideas?

解决方案

Oh dear. In the implementation of the previous view controller, I accidentally set self.title to @"", which causes this annoying bug.

Remove this line solves the problem.

这篇关于UINavigationController的后退按钮消失?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆