【发布时间】:2021-10-06 13:48:15
【问题描述】:
我想通过代码定义状态栏的颜色,我发现它的方式是这个,但它已被弃用。有谁知道这样做的新方法是什么?这个警告在我所有的代码中都跟着我
此代码正在运行,但出现警告
谁想要的代码:
class AppDelegate: UIResponder, UIApplicationDelegate {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
UIApplication.shared.statusBarStyle = UIStatusBarStyle.lightContent
return true
}
【问题讨论】: