简体   繁体   English

Swift Xcode 11.4。 将返回按钮添加到 TableView 导航项

[英]Swift Xcode 11.4. add back button to the TableView navigation item

I am trying to add "Close" or "Back" button onto TableViewController visited by segue.我正在尝试在 segue 访问的 TableViewController 上添加“关闭”或“返回”按钮。 I am using Storyboard.我正在使用 Storyboard。 I am unable to move the elements I want to.我无法移动我想要的元素。 And this is not working.这是行不通的。

代码

What am I doing wrong please?请问我做错了什么? How can I add back or close button into header (or navbar) of this controller.如何将返回或关闭按钮添加到此 controller 的 header(或导航栏)中。

Result is结果是

屏幕

that I don't have title or Back.我没有标题或返回。 If I embed it in Navigation controller, I have just title, but without any buttons or navs.如果我将它嵌入到导航 controller 中,我只有标题,但没有任何按钮或导航。

If I embed TableView controller into Navigation Controller, I got this如果我将 TableView controller 嵌入到导航 Controller 中,我得到了这个

在此处输入图像描述

I can see it right there, but not working.我可以在那里看到它,但无法正常工作。

在此处输入图像描述

and here和这里

在此处输入图像描述

Thanks谢谢

Try to change Kind option in Storyboard segue settings to Show .尝试将 Storyboard segue 设置中的 Kind 选项更改为Show You will have back button created automatically.您将自动创建后退按钮。

在此处输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM