admin管理员组文章数量:1391960
I've created an app which is working as expected. The app is only running on an Android device with a dark mode theme, and should always appear dark.
I did notice one small visual bug I would like to solve. When the Android device has the "Force Dark mode" in the "Developer options" turned on, some of the objects (mostly vector images) change their color.
I would like to keep it on on my device, because of some other apps.
Here is an example of how an image should look (left), and how it looks with Force Dark mode (right):
After searching for a solution, I've tried modifying my style.xml
file. I've been through many different styles with no effect.
I've also tried using the item "android:forceDarkAllowed"
with both true and false values, again with no effect.
Here is my style.xml
file:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Base application theme. -->
<style name="ThemeOverlay.AppCompat.Dark.NoActionBar" parent="ThemeOverlay.AppCompat.Dark">
<item name="android:forceDarkAllowed" >true</item>
<item name="android:background">#00000000</item> <!-- Or any transparency or color you need -->
<item name="android:windowNoTitle">true</item>
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:colorBackgroundCacheHint">@null</item>
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowAnimationStyle">@android:style/Animation.Translucent</item>
</style>
</resources>
本文标签: androidDeveloper option force dark mode changes app colorsStack Overflow
版权声明:本文标题:android - Developer option force dark mode changes app colors - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744765331a2624003.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论