[英]Status Bar Text Color on iPhone XR is different
Already checked answers from StackOverflow to change status bar color for the whole app is to set View controller-based status bar appearance
in info.plist to NO
and Status bar style
to UIStatusBarStyleLightContent
. 从StackOverflow已经检查过的答案可以更改整个应用程序的状态栏颜色,方法是将info.plist中
View controller-based status bar appearance
UIStatusBarStyleLightContent
为NO
,将Status bar style
UIStatusBarStyleLightContent
为UIStatusBarStyleLightContent
。
Well it did change from iPhone XS and lower, but iPhone XR and iPhone XS Max were not, Still solid black. 好吧,它确实从iPhone XS和更低版本改变了,但iPhone XR和iPhone XS Max却没有,仍然是纯黑色。 I tried to find in code if there is a code that called
UIStatusBarStyleDefault
but I dont see it anywhere. 我试图在代码中查找是否有一个名为
UIStatusBarStyleDefault
的代码,但我在任何地方都看不到。 My current fix now is to put this [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];
我当前的解决方法是将
[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];
on didFinishLaunchingWithOptions
. 在
didFinishLaunchingWithOptions
。 Any thoughts? 有什么想法吗? Thanks
谢谢
In iOS 12, setting NO
at View controller-based status bar appearance
in Info.plist
won't work anymore; 在iOS 12中,
Info.plist
View controller-based status bar appearance
NO
设置将不再起作用。 you must set it to YES
. 您必须将其设置为
YES
。 Your workaround is the recommended way to do so. 建议您采用解决方法。
Reference: https://stackoverflow.com/a/52443917/188331 参考: https : //stackoverflow.com/a/52443917/188331
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.