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

问题描述 投票:0回答:2

我试图首先从SWRevealViewControllerappdelegate,状态栏只显示临时和加载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

ios swift swrevealviewcontroller
2个回答
0
投票

试试这个编辑

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

0
投票

self.window = UIWindow(frame:UIScreen.main.bounds)

以某种方式添加此行使状态栏再次显示

© www.soinside.com 2019 - 2024. All rights reserved.