2

我正在尝试将此库https://github.com/jonkykong/SideMenu用于 swift4 中的侧边菜单。在新版本中,某些语法已被弃用。侧边菜单中的状态栏显示为黑色 SideMenuManager.default.menuFadeStatusBar = false

这之前工作得很好,但现在它给出了一个警告'menuFadeStatusBar' is deprecated: This property has been moved to the SideMenuNavigationController class. 图像,下面附有相同的图像。

在此处输入图像描述

出现侧面菜单时如何删除黑色状态栏?

4

3 回答 3

7

这是解决方案:

let leftMenuNavigationController = SideMenuNavigationController(rootViewController: YourViewController)
SideMenuManager.default.leftMenuNavigationController = leftMenuNavigationController

防止出现菜单时状态栏区域变黑:

leftMenuNavigationController.statusBarEndAlpha = 0
于 2019-09-09T12:48:44.590 回答
2

确保您已在情节提要的 Attributes Inspector 下将 StatusBarEndAlpha 的值设置为 0。我只做了这个更改,顶部的黑色视图消失了:

图片

于 2020-06-04T08:47:04.990 回答
1

Swift4 :- 我得到了另一个东西。侧边菜单按钮操作手动调用 SideMenu 类

    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)
        }
于 2019-09-17T08:07:19.980 回答