iOS Developer

iOS Status Bar 看这里就够啦

2016-12-24  本文已影响0人  Frankxzx

总结一下 status bar 的样式修改

开始动手吧


    override var preferredStatusBarStyle: UIStatusBarStyle {
        return .default
    }
    
    override var prefersStatusBarHidden: Bool {
        return isStatusBarHidden
    }
extension UINavigationController {

    open override var preferredStatusBarUpdateAnimation: UIStatusBarAnimation {
        return .slide
    }
    
    open override var childViewControllerForStatusBarStyle: UIViewController? {
        return visibleViewController
    }
    
    open override var childViewControllerForStatusBarHidden: UIViewController? {
         return visibleViewController
    }
    
}

这里有例子 Demo

上一篇下一篇

猜你喜欢

热点阅读