Android Webview:Don' t倒置图像中的黑暗主题
我们的应用程序中有几个WebViews,在尝试实现深色主题时,我们使用以下设置:
WebSettingsCompat.setForceDark(settings, WebSettingsCompat.FORCE_DARK_ON)
WebSettingsCompat.setForceDarkStrategy(settings, WebSettingsCompat.DARK_STRATEGY_PREFER_WEB_THEME_OVER_USER_AGENT_DARKENING)
问题是大多数页面都没有定义深层网络主题,因此用户代理人的变暗为用过的。文本内容正常工作,但是如果网络内容中有图像,它们的颜色也会反转,从而产生了非常奇怪的外观。
是否可以选择将图像排除在用户代理黑暗中?我在官方文档中没有找到有关此文件的任何文件。
We are having a couple of WebViews in our app, and when trying to implement the dark theme we use the following settings:
WebSettingsCompat.setForceDark(settings, WebSettingsCompat.FORCE_DARK_ON)
WebSettingsCompat.setForceDarkStrategy(settings, WebSettingsCompat.DARK_STRATEGY_PREFER_WEB_THEME_OVER_USER_AGENT_DARKENING)
The problem is that most of the pages doesn't have the dark web theme defined, so the user-agent darkening is used. Text content is working correctly, but if there are images in the web content their colors are inverted as well, resulting in a really strange look.
Is there any option to exclude images from the user-agent darkening? I haven't found any documentation about this in the official docs.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论