簡體   English   中英

啟動畫面 API 未在 Android 棒棒糖 5.0 和 5.1 上顯示圖標

[英]Splash Screen API not showing icon on Android lollipop 5.0 and 5.1

我正在使用啟動畫面 API,一切正常,但在 android 5.0 和 5.1 上沒有顯示圖標。

閃屏 API 版

implementation 'androidx.core:core-splashscreen:1.0.0'

主題.xml

<style name="Theme.Splash" parent="Theme.SplashScreen.IconBackground">
        <item name="postSplashScreenTheme">@style/Theme.MyTheme</item>
</style>

MainActivity.kt

val splashScreen = installSplashScreen()

清單.xml

<application
        android:allowBackup="true"
        android:dataExtractionRules="@xml/data_extraction_rules"
        android:fullBackupContent="@xml/backup_rules"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:name=".CarApplication"
        android:theme="@style/Theme.Splash"
        tools:targetApi="31">
        <activity
            android:theme="@style/Theme.Splash"
            android:name=".presentation.MainActivity"
            android:exported="true">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER"/>
            </intent-filter>
        </activity>
 </application>

Android 版本 11

在此處輸入圖像描述

Android 版本 5.0

在此處輸入圖像描述

現在我需要做的就是在帶有 android 5.0 的設備上顯示圖標。 我在文檔中做了所有事情,但它似乎不適用於 android 5.0

從 Android Studio 啟動應用程序時,由 Splashscreen API 設置的圖標不起作用。 如果應用程序關閉然后重新啟動,則圖標會正確顯示。

由於此庫的早期 alpha 狀態,此錯誤可能存在,據稱將在 Splashscreen API 的未來版本中修復。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM