ios - 使用(或不使用)导航 Controller 的栏推送到导航堆栈

标签 ios swift uinavigationcontroller uinavigationbar pushviewcontroller

我创建了一个 View Controller ,它需要能够使用自己的导航栏,但仍包含在导航堆栈中。我已经通过简单地隐藏 UINavigationController 的导航栏,然后在每个 View Controller 中添加一个假导航栏来解决这个问题。这样,每次插入 View Controller 时,我都会看到以下外观。 This is the look for pushing/popping I'm getting for every view controller. I only need this look in one specific view controller.

我想要的是一些推送导致使用传入 View Controller 的导航栏(图像1),然后其他推送导致此Regular navigation controller push

最佳答案

在哪个 View Controller 上您需要在该 View Controller 上使用自定义导航栏,在viewWillAppear中隐藏导航栏并在viewDidDisappear中再次显示。因此,对于特定的 View Controller 来说,它将被隐藏。并在 viewDidload

的 View Controller 中显示您的自定义导航栏

关于ios - 使用(或不使用)导航 Controller 的栏推送到导航堆栈,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37630412/

相关文章:

ios - 向 popToRootViewController 添加自定义动画

在 0.667 和 3.833 Hz 范围内快速实现 IIR 滤波器

ios - 将一个导航栏更改为透明会将所有导航栏更改为透明

iOS UINavigationController barHideOnTapGestureRecognizer 和 UIButton 干扰

swift - 为什么我的背景渐变 View 没有加载到我的客户 UINavigationController 类中

ios - NSOperation 中的 AFNetworking 操作

ios - 如何设置 Today Widget Extension 的高度?

ios - 如何让 UISearchController 开始隐藏?

swift - 如何在 Swift 4 中增加 Index.String 类型的变量?

Swift:将类型作为参数传递