iPhone XR 上的状态栏文本颜色不同 [英] Status Bar Text Color on iPhone XR is different
问题描述
已经从 StackOverflow 检查答案以更改整个应用程序的状态栏颜色是将 info.plist 中的 View controller-based status bar appearance
设置为 NO
和 >状态栏样式
到UIStatusBarStyleLightContent
.
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
.
它确实从 iPhone XS 及更低版本发生了变化,但 iPhone XR 和 iPhone XS Max 没有发生变化,仍然是纯黑色.我试图在代码中查找是否有一个名为 UIStatusBarStyleDefault
的代码,但我在任何地方都没有看到它.我现在的解决方法是将这个 [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];
放在 didFinishLaunchingWithOptions
上.有什么想法吗?谢谢
Well it did change from iPhone XS and lower, but iPhone XR and iPhone XS Max were not, Still solid black. I tried to find in code if there is a code that called UIStatusBarStyleDefault
but I dont see it anywhere. My current fix now is to put this [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];
on didFinishLaunchingWithOptions
. Any thoughts? Thanks
推荐答案
在 iOS 12 中,在 Info 中的
将不再起作用;您必须将其设置为 View controller-based status bar appearance
设置 NO
.plistYES
.建议采用您的解决方法.
In iOS 12, setting NO
at View controller-based status bar appearance
in Info.plist
won't work anymore; you must set it to YES
. Your workaround is the recommended way to do so.
参考:https://stackoverflow.com/a/52443917/188331
这篇关于iPhone XR 上的状态栏文本颜色不同的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!