0.環(huán)境
swift 4诺苹、
iOS 11
1.第一步
在 info.plist
中,新添加一行View controller-based status bar appearance
舰罚,值設(shè)置為NO
2.第二步
在指定的ViewController中栅螟,覆蓋viewWillAppear
方法幅疼,如下:
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
UIApplication.shared.statusBarStyle = .lightContent
}