【问题标题】:Swift4 Side Menu Shows Black Status BarSwift4 侧边菜单显示黑色状态栏
【发布时间】:2019-09-09 07:14:12
【问题描述】:

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

这之前工作正常,但现在它发出警告'menuFadeStatusBar' is deprecated: This property has been moved to the SideMenuNavigationController class. 下面附上相同的图片。

出现侧边菜单时如何移除黑色状态栏?

【问题讨论】:

  • 问题是……?
  • 出现侧边菜单时如何删除黑色状态栏? @JoakimDanielson

标签: ios swift4


【解决方案1】:

这里是解决方案:

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

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

leftMenuNavigationController.statusBarEndAlpha = 0

【讨论】:

    【解决方案2】:

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

    【讨论】:

      【解决方案3】:

      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)
              }
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2018-02-25
        • 1970-01-01
        • 1970-01-01
        • 2018-01-01
        • 1970-01-01
        • 2021-10-04
        • 1970-01-01
        相关资源
        最近更新 更多