Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/183.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/xml/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 启动屏幕';s的颜色不会在夜间模式下更新_Android_Xml_Splash Screen - Fatal编程技术网

Android 启动屏幕';s的颜色不会在夜间模式下更新

Android 启动屏幕';s的颜色不会在夜间模式下更新,android,xml,splash-screen,Android,Xml,Splash Screen,我正在使用XML方法实现我的启动屏幕(以避免冷启动时出现空白屏幕)。 但问题是我的背景不会随着夜间模式而改变,它仍然是白色的。 有人能带我出去吗 res\drawable\splash\u screenbg.xml <?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android

我正在使用XML方法实现我的启动屏幕(以避免冷启动时出现空白屏幕)。 但问题是我的背景不会随着夜间模式而改变,它仍然是白色的。 有人能带我出去吗

res\drawable\splash\u screenbg.xml

<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:drawable="@color/mainBG" />
    <!--
    <item>
        <bitmap
            android:gravity="center"
            android:src="@drawable/signin_img"/>
    </item>
    -->
</layer-list>
<activity
            android:name=".SplashScreen"
            android:screenOrientation="portrait"
            android:theme="@style/SplashScreen">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>

        </activity>
        <activity
            android:name=".MainActivity"
            android:launchMode="singleTop"
            android:screenOrientation="portrait">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>

我的主题/主题夜资源文件包含这种风格 res\themes.xmlres\themes.xml(夜间)


@可拉伸/飞溅屏幕BG
这是我清单文件中的代码片段 清单\AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:drawable="@color/mainBG" />
    <!--
    <item>
        <bitmap
            android:gravity="center"
            android:src="@drawable/signin_img"/>
    </item>
    -->
</layer-list>
<activity
            android:name=".SplashScreen"
            android:screenOrientation="portrait"
            android:theme="@style/SplashScreen">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>

        </activity>
        <activity
            android:name=".MainActivity"
            android:launchMode="singleTop"
            android:screenOrientation="portrait">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>

添加到colors.xml(night):

#000000

或者将颜色更改为您的自定义颜色。

我添加了它,但它仍然不起作用