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

Setter for statusBarStyle was deprecated in iOS 90 Use -UIViewController preferredStatusBarStyle

原文地址: https://www.cveoy.top/t/topic/icnf 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录