iOS如何解决横屏状态栏(时间 电量)不显示的bug

在基类里覆盖:

extension C4MVTBaseController {

    override var preferredStatusBarStyle: UIStatusBarStyle {
        get {
            return .default
        }
    }

    override var preferredStatusBarUpdateAnimation: UIStatusBarAnimation {
        get {
            return .none
        }
    }

    override var prefersStatusBarHidden: Bool {
        get {
            return false
        }
    }
}

如果要彻底隐藏状态栏的时候:

把最底下的false改成true即可。

Leave a Reply

Your email address will not be published. Required fields are marked *