没有导航控制器的 pushViewController

2023-06-11移动开发问题
4

本文介绍了没有导航控制器的 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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

The End

相关推荐

硬件音量按钮更改应用程序音量
Hardware Volume buttons change in app volume(硬件音量按钮更改应用程序音量)...
2024-08-12 移动开发问题
10

恢复游戏 cocos2d
Resume game cocos2d(恢复游戏 cocos2d)...
2024-08-12 移动开发问题
6

Cocos2D + 仅禁用 Retina iPad 图形
Cocos2D + Disabling only Retina iPad Graphics(Cocos2D + 仅禁用 Retina iPad 图形)...
2024-08-12 移动开发问题
10

[ios.cocos2d+box2d]如何禁用自动旋转?
[ios.cocos2d+box2d]how to disable auto-rotation?([ios.cocos2d+box2d]如何禁用自动旋转?)...
2024-08-12 移动开发问题
7

cocos2D iPhone中的UItextfield文本对齐问题
UItextfield text alignment issue in cocos2D iPhone(cocos2D iPhone中的UItextfield文本对齐问题)...
2024-08-12 移动开发问题
7

从 Documents 目录存储和读取文件 iOS 5
Storing and reading files from Documents directory iOS 5(从 Documents 目录存储和读取文件 iOS 5)...
2024-08-12 移动开发问题
9