Home > OS >  navigator.splashscreen.hide() not working on [email protected]
navigator.splashscreen.hide() not working on [email protected]

Time:11-06

I just upgraded to [email protected] targeting API 31. This required replacing the splash screen plugin from my previous builds. I use AutoHideSplashScreen = false so that I can hide the splash screen after the UI is rendered. This works fine on iOS but the splash screen persists forever on Android despite calls to navigator.splashscreen.hide() (even with the debugger). This happened both on API 31 and older devices. I resorted to auto-hide with a long fade for now, to get something working. I tried several different config.xml variants so I'm not sure whether putting one here will be useful, but for all of them AutoHideSplashScreen = false on Android did not work.

CodePudding user response:

You need to set it up in your config.xml

 <preference name="AutoHideSplashScreen" value="false" />

CodePudding user response:

You will have to modify that in your platforms\android\app\src\main\res\values\themes.xml file

this is how mine looks

 <?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>

Please consider only the splash screen part

  • Related