我刚刚升级到cordova-android@11.0.0,目标是API 31。这需要替换我以前构建的splash插件。我使用AutoHideSplashScreen = false,这样就可以在UI呈现后隐藏启动屏幕。这在iOS上运行得很好,但是即使调用了navigator.splashscreen.hide() (即使是调试器),启动屏幕在Android上也永远存在。这既发生在API 31上,也发生在更旧的设备上。现在,我不得不用自动隐藏的方法来解决一些问题。我尝试了几种不同的config.xml变体,所以我不确定在这里放置一个是否有用,但对所有这些人来说,AutoHideSplashScreen = false在安卓上都不起作用。
发布于 2022-11-06 13:14:15
您必须在platforms\android\app\src\main\res\values\themes.xml文件中修改它。
这就是我的样子
<?xml version='1.0' encoding='utf-8'?>
<resources>
<style name="Theme.App.SplashScreen" parent="Theme.SplashScreen.IconBackground">
<item name="windowSplashScreenBackground">@color/cdv_splashscreen_background</item>
<item name="windowSplashScreenAnimatedIcon">@drawable/ic_cdv_splashscreen</item>
<item name="windowSplashScreenAnimationDuration">200</item>
<item name="android:windowIsTranslucent">true</item>
<item name="postSplashScreenTheme">@style/Theme.AppCompat.NoActionBar</item>
</style>
<style name="MyTheme" parent="android:Theme.Holo.Light">
</style>请只考虑启动屏幕部分
https://stackoverflow.com/questions/74249054
复制相似问题