问题描述
我们的应用依靠AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES)
来使我们从values/colors
和values-night/colors
Our app relies on AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES)
to make us pick up Light and Dark theme colors from values/colors
and values-night/colors
但是每次我们尝试使用WebView
时,都会从重置UiMode开始,我们的应用程序会感到困惑,哪些颜色值适合我们的主题
But every time we try to use the WebView
, it starts by resetting the UiMode and our app gets confused which color values to pick for our themes
Some people discussed the issue in detail here and here
有人在那里遇到类似的问题吗?
Anyone out there run into a similar issue?
推荐答案
回答我自己的问题,看起来Google修复了问题 https://issuetracker.google.com/issues/37124582
Answering my own question, looks like Google fixed the issue https://issuetracker.google.com/issues/37124582
带有 https://developer.android.com/jetpack/androidx/releases/appcompat#1.1.0-alpha03 Fixed WebView resets DayNight Resources
这篇关于WebView重置UiMode并打破黑暗主题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!