iPhone XR 上的状态栏文本颜色不同 [英] Status Bar Text Color on iPhone XR is different

查看:40
本文介绍了iPhone XR 上的状态栏文本颜色不同的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

已经从 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.plist 将不再起作用;您必须将其设置为 YES.建议采用您的解决方法.

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆