简体   繁体   English

为什么我的视图控制器没有后退按钮?

[英]Why doesn't my view controller have a back button?

In the picture below (We'll call them storyboard item A, B, C in order from left to right), View controller 'C' does not show a back button but I embedded it in a Navigation Controller. 在下面的图片中(我们将其从左到右依次称为故事板项目A,B,C),视图控制器“ C”没有显示后退按钮,但我将其嵌入了导航控制器中。 Other Stack overflow posts have not worked. 其他Stack溢出帖子无效。 How do I get the back button to show? 如何显示后退按钮? 在此处输入图片说明

Move the Navigation Controller to the "first" view controller (ie: the view controller that does the "pushing" or "showing"). 将导航控制器移动到“第一个”视图控制器(即:执行“推”或“显示”的视图控制器)。 The Navigation Controller should not be embedded in the view controller that contains the back button but rather in the view controller upstream of it. 导航控制器不应嵌入包含后退按钮的视图控制器中,而应嵌入在其上游的视图控制器中。 This is the main cause of confusion. 这是造成混乱的主要原因。

在此处输入图片说明

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

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