gpt4 book ai didi

ios - 为什么我在导航 Controller 以编程方式返回后看不到顶部栏

转载 作者:行者123 更新时间:2023-11-29 00:51:23 25 4
gpt4 key购买 nike

我有带有 rootViewController 和 childViewController 的导航 Controller 。当我启动我的应用程序时,我在 rootViewController 上看到顶部栏。然后我通过 segue 进入 childViewController 并尝试返回 rootViewController

 @IBAction func exitButtonAction(sender: AnyObject) {
navigationController?.popToRootViewControllerAnimated(true)
}

但它是在没有顶部栏的情况下开始的。我以编程方式返回,因为我的 childViewController 顶部栏是隐藏的。我该如何解决?

最佳答案

这是一个 bool 值,可以解决你所需要的: self.navigationController?.navigationBarHidden = true

在需要时将其设置为 true 或 false。

关于ios - 为什么我在导航 Controller 以编程方式返回后看不到顶部栏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38115141/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com