后退按钮未显示在导航控制器中 [英] Back button does not show up in navigation controller

查看:35
本文介绍了后退按钮未显示在导航控制器中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在一个视图控制器中的表格单元格中添加了一个显示转场到另一个嵌入在导航控制器中的表格视图.当我单击第一个视图中的单元格时,segue 按预期工作并显示新视图.但是,返回"按钮(带有原始视图的标题)不会出现在导航栏中.

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.

我搜索了 SO,发现过去曾问过很多这样的问题(针对 Swift 和 Objective-C).他们中的大多数人建议第一个视图需要一个标题才能工作.我有一个头衔.我什至以编程方式添加了一个,以防万一.那没有帮助.一个答案建议在 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.

我还能如何调试这个问题?

How else can I debug this issue?

推荐答案

问题似乎在于您正在推入一个全新的 navigationController,将其删除,然后直接进入新的查看Detail本身,它们必须在同一个navigationController中才能工作

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

这篇关于后退按钮未显示在导航控制器中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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