我的 UINavigationController 缺少后退按钮(左按钮)但点击左按钮似乎仍然有效.
I have a scenario where my UINavigationController is missing the back button (left button) but tapping the left button still seems to work.
我在此处发现了类似的问题:UINavigationController 的后退按钮消失?通过不将标题设置为@"解决了这个问题,但这不是我的问题.是否有任何其他情况会导致此行为?
I found a similar problem posted here: UINavigationController's back button disappears? which was resolved by not setting the title to @"", but that's not my problem. Are there any other scenarios that would cause this behaviour?
更新:
如果重要的是我的视图层次结构:我的 MainWindow 包含一个 UINavigationView,它首先加载一个 UIViewController(这个视图包含一个地图).当点击注释附件按钮时,它会加载一个 UITableViewController.正是这个视图应该有后退按钮.
In case it matters here is my view hierarchy: My MainWindow contains a UINavigationView which first loads a UIViewController (this view contains a Map). When tapping on an annotation accessory button it then loads a UITableViewController. It's this view that should have the back button.
谢谢.
天啊!好的,我在 iphonedevsdk.com 上的一篇文章中找到了答案,现已不复存在.
Oh Man! Ok, I found the answer in an article on iphonedevsdk.com, now defunct.
事实证明,我的第一个视图(上面有地图的那个)没有设置标题(实际上我隐藏了导航栏,因为我不想显示它).即使在稍后的视图中设置了标题,SDK 似乎也不在乎.我仍然不能 100% 理解为什么我可以点击该区域以使其工作.
It turns out that my first view (the one with the map on it) didn't have a title set (in fact I hide the navigation bar because I didn't want to show it). Even if the title WAS set on a later view the SDK doesn't seem to care. I still don't understand 100% why I could tap in the area to get it to work.
所以即使我隐藏了第一个导航栏,我仍然需要设置它的标题.
So even though I hide the first navigation bar I still need to set the title of it.
做到了!
感谢所有尝试提供帮助的人.
Thanks to everyone who tried to help.
这篇关于UINavigationController 后退按钮不可见,但有效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!