将ViewController嵌入到NavigationController中没有“返回"按钮.按钮 [英] Embedding a ViewController in a NavigationController does not have "Back" button

查看:76
本文介绍了将ViewController嵌入到NavigationController中没有“返回"按钮.按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

将视图控制器嵌入导航控制器后,如何显示后退按钮?一点背景:

How can I get the back button to show after I embed a view controller into a navigation controller? A little background:

在应用中进行访问时,下图中显示的详细信息" VC在导航栏中具有返回"按钮,如您所知,该按钮可将您带回到表格视图.我想让添加目标" VC也以下面的方式显示,因此我将其嵌入到导航控制器中.由于某种原因,在应用程序中访问该页面时,默认情况下没有VC所具有的详细信息",没有返回"按钮.如何显示该后退按钮,以便用户可以导航回表视图?

The "Detail" VC shown in the image below when visited in the app has a "Back" button in the nav bar which as you know brings you back to the table view. I want to have the "Add Goal" VC also seen below to be shown modally so I embedded it into a nav controller. For some reason when that page is visited in the app it has no "Back" button by default like the "Detail" VC has. how can I get that back button to show so the user can navigate back to the table view?

请让我知道是否有人需要更多信息!

Please let me know if anyone needs any more information!

推荐答案

为什么不添加导航栏并在其上拖动栏按钮.然后在该按钮方法的功能中写入

Why don't you add a navigation bar and drag a bar button on it . And in the function of that buttons method write

[self dismissViewControllerAnimated:YES completion:nil];

这篇关于将ViewController嵌入到NavigationController中没有“返回"按钮.按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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