Splash Screen API在Android 5.0和5.1的Lollipop版本上没有显示图标。

4

我正在使用启动画面API,一切工作正常,但在Android 5.0和5.1上无法显示图标。

启动画面API版本

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

Theme.xml

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

MainActivity.kt

val splashScreen = installSplashScreen()

Manifest.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 版本

输入图像描述

现在我需要在安卓 5.0 设备上显示该图标。 我已经按照文档中的说明做了一切,但它在安卓 5.0 上似乎无法正常工作。

1个回答

4

如果我们想要显示图标,对于这些版本我们能做些什么? - mrzbn

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接