xcode 后退按钮未显示在导航控制器中
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/38448726/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Back button does not show up in navigation controller
提问by Vijay
I have added a show segue from table cell in one view controller to another table view embedded in a navigation controller. When I click on the cell in the first view the segue works as expected and brings up the new view. However, the "Back" button (with the title of the original view) does not appear in the navigation bar.
我在一个视图控制器中的表格单元格中添加了一个 show segue 到另一个嵌入在导航控制器中的表格视图。当我单击第一个视图中的单元格时,segue 按预期工作并显示新视图。但是,“返回”按钮(带有原始视图的标题)不会出现在导航栏中。
I searched SO and found a number of such questions asked in the past (both for Swift and Objective-C). Most of them suggest that the first view needs a title for this to work. I do have a title. I even added one programmatically, just in case. That did not help. One of the answers suggested to add an identifier to the segue; that didn't help me either.
我搜索了 SO,发现过去有很多这样的问题(针对 Swift 和 Objective-C)。他们中的大多数人建议第一个视图需要一个标题才能工作。我有一个头衔。我什至以编程方式添加了一个,以防万一。那没有帮助。一个答案建议在 segue 中添加一个标识符;那也没有帮助我。
How else can I debug this issue?
我还能如何调试这个问题?
回答by Tj3n
It seems like the problem is that you are pushing into a totally new navigationController
, remove it, and make segue dirrectly into the new view Detail
itself, they have to be in the same navigationController
to work
似乎问题在于您正在推入一个全新的navigationController
,将其删除,然后直接进入新视图Detail
本身,它们必须处于相同navigationController
的工作状态
回答by Alex Delgado
Verify you are not hiding backbutton in destination controller...
验证您没有在目标控制器中隐藏后退按钮...