UINavigationController后退按钮不可见,但有效 [英] UINavigationController Back Button not visible, but works

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

问题描述

我有一个场景,我的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(该视图包含一个Map)。当点击注释附件按钮时,它会加载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.

谢谢。

推荐答案

<哦,伙计!好的,我在这里找到答案:
http://www.iphonedevsdk.com/forum/iphone-sdk-development/35633-back-button-missing-navigation-bar.html

事实证明我的第一个视图(带有地图的视图)没有标题集(实际上我隐藏了导航栏,因为我不想显示它)。即使标题WAS在稍后的视图中设置,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后退按钮不可见,但有效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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