Sandeep Singh
Sandeep Singh

Reputation: 89

White screen shows instead of splash screen --ionic 4

I am working on a project in ionic 4 ,when i try to change the icon and splash screen of my own .i replace my icon with icon.png and splash with splash.png after ionic Cordova resources run. app icon is successfully replaced with my new icon in icon folder and splash screen also replaced with my new screen in splash folder, after build android the icon is changed but the splash screen is not visible at all only a white screen shows for 5-7 sec and then show my app's home page. if anyone know how to solve that please let my know.

Upvotes: 1

Views: 545

Answers (1)

RobrechtVM
RobrechtVM

Reputation: 936

I remember struggling with that issue as well, it was solved by adding some preferences in the config.xml.

This is in my current (ionic 3) project, hope this helps.

<preference name="webviewbounce" value="false" />
<preference name="UIWebViewBounce" value="false" />
<preference name="DisallowOverscroll" value="true" />
<preference name="android-minSdkVersion" value="16" />
<preference name="BackupWebStorage" value="none" />
<preference name="AutoHideSplashScreen" value="false" />
<preference name="SplashMaintainAspectRatio" value="true" />
<preference name="FadeSplashScreenDuration" value="1000" />
<preference name="FadeSplashScreen" value="true" />
<preference name="SplashShowOnlyFirstTime" value="false" />
<preference name="SplashScreen" value="screen" />
<preference name="SplashScreenDelay" value="30000" />
<preference name="ShowSplashScreen" value="true" />
<preference name="ShowSplashScreenSpinner" value="false" />

EDIT

Also make sure you have the cordova splashscreen plugin installed

ionic cordova plugin add cordova-plugin-splashscreen

npm install --save @ionic-native/splash-screen

Upvotes: 1

Related Questions