自定义启动屏幕未显示

时间:2018-06-27 11:59:00

标签: java android

我现在添加了一个仅带有公司徽标的新启动屏幕,我将其添加到可以想象一切正常的位置,但是在加载应用程序时仍然只有白色屏幕。有什么想法吗?

Styles.xml

<resources>

    <!-- Base application theme. -->
    <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
        <!-- Customize your theme here. -->
        <item name="colorPrimary">@color/colorPrimary</item>
        <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
        <item name="colorAccent">@color/colorAccent</item>
    </style>

    <style name="AlertDialogDarkBlue" parent="Theme.AppCompat.Dialog.Alert">
        <item name="android:textColor">@color/colorWhite</item>
        <item name="textColorAlertDialogListItem">@color/colorWhite</item>
        <item name="android:background">@color/colorDarkBlue</item>
        <item name="android:colorAccent">@color/colorWhite</item>
    </style>

    <style name="AppTheme.NoActionBar">
        <item name="windowActionBar">false</item>
        <item name="windowNoTitle">true</item>
    </style>

    <style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />

    <style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />

    <style name="AppTheme.Launcher">
        <item name="android:windowBackground">@drawable/launch_screen</item>
    </style>

</resources>

launch_screen.xml

<?xml version="1.0" encoding="utf-8"?>

<!-- The android:opacity=”opaque” line — this is critical in preventing a flash of black as your theme transitions. -->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" android:opacity="opaque">

    <!-- The background color, preferably the same as your normal theme -->
    <item android:drawable="@android:color/white"/>

    <!-- Your product logo - 144dp color version of your app icon -->
    <item>

        <bitmap
            android:src="@drawable/white_lblue_logo"
            android:gravity="center"/>

    </item>

</layer-list>

清单图片enter image description here

0 个答案:

没有答案