当黑暗模式开启时,Jetpack 初始屏幕图标不显示

you*_*ung 8 android splash-screen kotlin android-jetpack

我已经使用 Jetpack 启动屏幕 API 创建了一个启动屏幕,一切工作正常,只是windowSplashScreenAnimatedIcon在打开暗模式时没有显示。

尽管我使用的是材质日光主题,但还是强制选择了光作为默认主题 ( AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO))

我知道谷歌开发者门户上详细介绍了应用程序图标的注意事项,

<style name="Theme.App.Starting" parent="Theme.SplashScreen">
    <item name="windowSplashScreenBackground">@color/white</item>
    <item name="windowSplashScreenAnimatedIcon">@drawable/splash_content</item>
    <item name="windowSplashScreenAnimationDuration">500</item>
    <item name="postSplashScreenTheme">@style/Theme.Main</item>
</style>
Run Code Online (Sandbox Code Playgroud)

任何帮助将不胜感激。

谢谢

小智 0

我的图标在深色模式下全是黑色圆圈,但在浅色模式下是正常的 png。我的解决方案是我将 Splash API 从 androidx.core:core-splashscreen:1.0.0-beta01 更新为实现“androidx.core:core-splashscreen:1.1.0-alpha02”。