Setter for statusBarStyle was deprecated in iOS 90 Use -UIViewController preferredStatusBarStyle
In iOS 9.0, the statusBarStyle setter method was deprecated. Instead, you should use the preferredStatusBarStyle method of the UIViewController class to specify the preferred status bar style for a particular view controller.
You can override the preferredStatusBarStyle method in your view controller subclass like this:
override var preferredStatusBarStyle: UIStatusBarStyle {
return .lightContent // or .default, depending on your preference
}
This method should return the appropriate UIStatusBarStyle value that you want to use for the status bar in that view controller
原文地址: https://www.cveoy.top/t/topic/icnf 著作权归作者所有。请勿转载和采集!