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
基础教程推荐
- Cocos2d iPhone 非矩形精灵触摸检测 2022-01-01
- navigator.geolocation.getCurrentPosition 在 Android 浏览器上 2022-01-01
- 如何从 logcat 中删除旧数据? 2022-01-01
- NSString intValue 不能用于检索电话号码 2022-01-01
- libGDX 从精灵或纹理中获取像素颜色 2022-01-01
- Android:getLastKnownLocation(LocationManager.NETWORK_PROVIDER 2022-01-01
- 通过重定向链接在 Google Play 中打开应用 2022-01-01
- iOS4 创建后台定时器 2022-01-01
- iPhone - 获取给定地点/时区的当前日期和时间并将其与同一地点的另一个日期/时间进行比较的正确方法 2022-01-01
- AdMob 广告未在模拟器中显示 2022-01-01
