UIApplication.sharedApplication.statusBarHidden=是; 'statusBarHidden' 在 iOS13 中已弃用

UIApplication.sharedApplication.statusBarHidden=YES; 'statusBarHidden' is deprecated in iOS13

UIApplication.sharedApplication.statusBarHidden=YES;

在 iOS 13 中被弃用。编译器说 'use the statusBarManager property of the window scene instead'.

How/Where 你得到 statusBarManager 的句柄了吗?它不在 UIApplication.sharedApplication.windows.

删除 iOS13 中弃用的所有实例:

UIApplication.sharedApplication.statusBarHidden=YES;

而是将其添加到 plist 文件中:

<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
<key>UIStatusBarHidden</key>
<true/>