ios导航 Controller 推送 View Controller 但有后退按钮指向其他地方

标签 ios uinavigationcontroller pushviewcontroller

我的场景是这样的。我有 5 个 View Controller :Root , A , B , C , D

我目前在屏幕上 B我的导航堆栈包含 Root , A , B .

一旦用户对 B 执行了某个操作我想导航到 D没有任何其他屏幕显示,我想要 back button指向C .完整的导航堆栈应如下所示:Root => C => D .

如此有效,我想跳转到我的 root view controller , 然后按 C , 然后推 D .但是,我不想要 RootC出现。

这可能吗?

最佳答案

使用 B 中的 setViewControllers:animated: 方法将 CD 的实例推送到同时。对用户来说,这看起来像是一次简单的推送,但实际上您实际上是在弹出和推送多个 View 。

关于ios导航 Controller 推送 View Controller 但有后退按钮指向其他地方,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22506130/

相关文章:

iOS 首次启动之旅——检测应用是否首次启动

ios - Swift 中 navigationControllerSupportedInterfaceOrientations 的返回值是什么?

iphone - viewwillappear 和 viewdidappear 未调用

swift - 登录警报 swift 2.0 后打开一个新的 View Controller

iphone - 带有 pushViewController 动画的 popViewController

iphone - 首先导航,然后在 iPhone 应用程序中调用 viewDidLoad

ios - 如何让 xcode 在依赖项之前运行脚本?

iphone - 避免在 UIView 内拉伸(stretch) UIImageView

ios - 为什么我们在声明自定义 View 时不必使用 "frame"?

ios - 如何在 iOS13 上设置导航 Controller 中嵌入的状态栏的样式?