gpt4 book ai didi

ios - SWRevealViewController 不显示来自 Appdelegate 的状态栏推送

转载 作者:行者123 更新时间:2023-11-30 11:44:16 25 4
gpt4 key购买 nike

我首先尝试从 appdelegate 推送 SWRevealViewController,状态栏仅临时显示,加载 viewController 后它不会出现。

这是我的代码,我使用的是 swift:

let storyboard = UIStoryboard(name: "Main", bundle: nil)
let sw = storyboard.instantiateViewController(withIdentifier: "revealControllerStoryboard") as! SWRevealViewController
self.window?.rootViewController = sw

let destinationController = storyboard.instantiateViewController(withIdentifier: "searchViewStoryboard") as! SearchViewController
let navigationController = UINavigationController(rootViewController: destinationController)
sw.pushFrontViewController(navigationController, animated: true)

如何永久显示状态栏?这是图片

enter image description here enter image description here

最佳答案

试试这个编辑

let frontNavigationController:UINavigationController
let rearNavigationController:UINavigationController
let revealController = SWRevealViewController()
var mainRevealController = SWRevealViewController()

let menuTable = self.storyboard?.instantiateViewController(withIdentifier: "MenuViewController")as! MenuViewController
let homepage = self.storyboard?.instantiateViewController(withIdentifier: "HomeViewController") as! HomeViewController

frontNavigationController = UINavigationController(rootViewController: homepage)
rearNavigationController = UINavigationController(rootViewController: menuTable)
rearNavigationController.setNavigationBarHidden(true, animated: false)

revealController.frontViewController = frontNavigationController
revealController.rearViewController = rearNavigationController
revealController.delegate = self
mainRevealController = revealController

UIApplication.shared.delegate!.window?.rootViewController = mainRevealController

关于ios - SWRevealViewController 不显示来自 Appdelegate 的状态栏推送,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49027713/

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