![](/img/trans.png)
[英]'statusBarStyle' was deprecated in iOS 13.0: Use the statusBarManager property of the window scene instead
[英]How do I change the statusBarStyle using the statusBarManager in iOS 13.0+
我正在嘗試更改我的 iOS 13.0 應用程序中的狀態欄樣式,但是當我使用代碼時;
UIApplication.shared.statusBarStyle = .lightContent
我在 Xcode 收到警告;
'statusBarStyle' was deprecated in iOS 13.0: Use the statusBarManager property of the window scene instead
問題是屬性statusBarManager?.statusBarStyle
是一個只獲取屬性,所以我如何以編程方式更改狀態欄樣式?
將 info.plist 中基於視圖控制器的狀態欄外觀鍵值設置為 NO,並以編程方式將 UIApplication.shared.statusBarStyle 設置為 .lightContent 或 .default。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.