swift - UINavigationBar 在模态上消失

标签 swift uinavigationcontroller

我在 Swift 中有一个导航栏设置,它可以正确切换到其他导航 View Controller ,但是当我点击设置为模式返回当前 View Controller 的按钮以刷新内容时,导航栏消失了!这是如何解决的?

最佳答案

你说

...but when I hit a button that is set to modal back to current view controller...

这没有道理。模态框是一个新的 View Controller ,它显示在当前 View Controller 的顶部,完全遮盖它。你不会“模态返回”任何东西。如果您想返回到导航堆栈中的上一个 View Controller ,您可能需要使用 popToViewController:animated: 方法,或者如果您要通过以下方式返回到上一个 View Controller ,请使用展开转场继续。

关于swift - UINavigationBar 在模态上消失,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30059733/

相关文章:

swift - 无法设置可选值,打印 nil

ios - Swift:如何在使用 XLPagerTabStrip 中的 subview Controller 后返回到第一个 View Controller

操作系统。导航 Controller 。重用 View Controller

iphone - iOS 如何使 UITabBar 和 UINavigationController 变暗而不隐藏它们?

ios - 如何在 UINavigationController 中的单个 View 上强制使用特定的 UIInterfaceOrientation?

swift - TableViewCell 元素中的 UIMenuController

ios - 索引 Firestore 多个值

ios - 选择/拍摄后如何将图像从相机/相机胶卷传递到新 View ?

ios - 为什么最新的 Swift 版本总是说变量在使用前没有初始化

ios - 如何将 JKAutoShrinkView 或 GTScrollNavigationBar 与 Storyboard一起使用