如何实现启动屏幕的夜间模式?

时间:2019-10-30 20:30:05

标签: android splash-screen android-night-mode

我设法为我的应用添加了夜间模式。它适用于整个应用程序(启动画面除外)。启动画面使用OS夜间模式设置。我的应用程序级别更改不适用于初始屏幕。在启动画面中有什么方法可以处理夜间模式?

样式:

<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(晚上)

<color name="compatible_night">#121212</color>

colors.xml

<color name="compatible_night">#FFFFFF</color>

我试图在夜间文件夹中使用样式,在夜间文件夹中使用颜色,在夜间文件夹中使用图层列表,没有任何作用

0 个答案:

没有答案
相关问题