Swift4 侧边菜单显示黑色状态栏
Swift4 Side Menu Shows Black Status Bar
我正在尝试将此库 https://github.com/jonkykong/SideMenu 用于 swift4 中的侧边菜单。在新版本中,一些语法是 deprecated.The 侧边菜单中的状态栏显示黑色 SideMenuManager.default.menuFadeStatusBar = false
这之前工作正常,但现在发出警告 'menuFadeStatusBar' is deprecated: This property has been moved to the SideMenuNavigationController class.
下面附有相同的图片。
出现侧边菜单时如何删除黑色状态栏?
解决方法如下:
let leftMenuNavigationController = SideMenuNavigationController(rootViewController: YourViewController)
SideMenuManager.default.leftMenuNavigationController = leftMenuNavigationController
防止菜单出现时状态栏区域变黑:
leftMenuNavigationController.statusBarEndAlpha = 0
Swift4 :- 我得到了另一个东西。
在侧面菜单按钮操作上手动调用 SideMenu class
let storyboard = UIStoryboard(name: "Main", bundle: nil)
if let theController = storyboard.instantiateViewController(withIdentifier: "SideMenuNavigationController") as? SideMenuNavigationController {
SideMenuPresentationStyle.menuSlideIn.backgroundColor = UIColor.clear
theController.presentationStyle = .menuSlideIn
theController.presentationStyle.backgroundColor = UIColor.clear
navigationController?.present(theController, animated: true, completion: nil)
}
确保您已在故事板的属性检查器下将 StatusBarEndAlpha 的值设置为 0。我只做了这个更改,顶部的黑色视图消失了:
我正在尝试将此库 https://github.com/jonkykong/SideMenu 用于 swift4 中的侧边菜单。在新版本中,一些语法是 deprecated.The 侧边菜单中的状态栏显示黑色 SideMenuManager.default.menuFadeStatusBar = false
这之前工作正常,但现在发出警告 'menuFadeStatusBar' is deprecated: This property has been moved to the SideMenuNavigationController class.
下面附有相同的图片。
出现侧边菜单时如何删除黑色状态栏?
解决方法如下:
let leftMenuNavigationController = SideMenuNavigationController(rootViewController: YourViewController)
SideMenuManager.default.leftMenuNavigationController = leftMenuNavigationController
防止菜单出现时状态栏区域变黑:
leftMenuNavigationController.statusBarEndAlpha = 0
Swift4 :- 我得到了另一个东西。 在侧面菜单按钮操作上手动调用 SideMenu class
let storyboard = UIStoryboard(name: "Main", bundle: nil)
if let theController = storyboard.instantiateViewController(withIdentifier: "SideMenuNavigationController") as? SideMenuNavigationController {
SideMenuPresentationStyle.menuSlideIn.backgroundColor = UIColor.clear
theController.presentationStyle = .menuSlideIn
theController.presentationStyle.backgroundColor = UIColor.clear
navigationController?.present(theController, animated: true, completion: nil)
}
确保您已在故事板的属性检查器下将 StatusBarEndAlpha 的值设置为 0。我只做了这个更改,顶部的黑色视图消失了: