pushViewController without navigationcontroller(没有导航控制器的 pushViewController)
问题描述
我有一个类型为 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.
您可以推送任意UINavigationItems 到您的 UINavigationBar 上,当用户使用后退按钮时,您的 bar 代表将收到通知,以便您采取适当的操作.有关详细信息,请参阅文档.
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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:没有导航控制器的 pushViewController


基础教程推荐
- Android - 如何在runOnUiThread 中将数据传递给Runnable? 2022-01-01
- 在 iOS 7 下 CCMenu 错位 2022-01-01
- 在视图控制器的宽度上水平均匀分布 UIButton 的最简单方法? 2022-01-01
- 从 UIWebView 访问元数据 2022-01-01
- 更改 UITableView 部分标题的颜色 2022-01-01
- iOS4 创建后台定时器 2022-01-01
- UINavigationItem 的持久 rightBarButtonItem 属性 2022-01-01
- Firebase 云消息传递令牌未生成 2022-01-01
- EditText 中的 setHintTextColor() 2022-01-01
- UINavigationBar 隐藏按钮文本 2022-01-01