pushViewController没有navigationcontroller [英] pushViewController without navigationcontroller

查看:433
本文介绍了pushViewController没有navigationcontroller的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个类型为UITableViewController的类。
此类有一个UINavigationBar类型的成员,我用它来添加表视图的编辑按钮。

I have a class that is of type UITableViewController. This class has a member of type UINavigationBar that I use for adding in an edit button for the table view.

使用此方法调用无效。

[self.navigationController pushViewController:controller];

如何选择表格行而不将UITableViewCOntroller包装在一个表格行中,将详细视图推送到视图上UINavigationController?

How can I push a detail view onto the view after selecting a table row without wrapping my UITableViewCOntroller in a UINavigationController?

推荐答案

如果没有导航控制器,则无法将视图控制器推送到导航控制器。如果你想推动控制器并让它显示最顶层的控制器和一切,只需使用UINavigationController并完成它。

You can't push a view controller onto a navigation controller if there is no navigation controller. If you are wanting to be pushing controllers and have it display the topmost controller and everything, just use a UINavigationController and be done with it.

你可以推送任意 UINavigationItem 到您的UINavigationBar,你的酒吧当用户使用后退按钮时,将通知委托,以便您采取适当的措施。有关详细信息,请参阅文档

You can push arbitrary UINavigationItems onto your UINavigationBar, and your bar's delegate will be notified when the user uses the back button so you can take appropriate action. See the documentation for more information.

这篇关于pushViewController没有navigationcontroller的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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