我已经成功为我的应用程序添加了夜间模式。它适用于整个应用程序,除了启动画面。启动画面使用操作系统的夜间模式设置,而我应用程序级别的更改无法影响启动画面。有没有办法在启动画面中处理夜间模式?
风格:
<style name="SplashScreenTheme" parent="Theme.AppCompat.DayNight.DarkActionBar">
<item name="android:background">@drawable/logo</item>
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>
@drawable/logo:
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<color android:color="@color/compatible_night"/>
</item>
<item>
<bitmap
android:src="@drawable/grs"
android:tileMode="disabled"
android:gravity="center"
/>
</item>
</layer-list>
colors.xml(night)
<color name="compatible_night">#121212</color>
colors.xml
<color name="compatible_night">#FFFFFF</color>
我尝试在夜间模式文件夹中使用样式,颜色和层级列表,但是没有起作用。