我试图首先从SWRevealViewController
推appdelegate
,状态栏只显示临时和加载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)
如何永久显示状态栏?并且是图片
试试这个编辑
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
self.window = UIWindow(frame:UIScreen.main.bounds)
以某种方式添加此行使状态栏再次显示