'Cordova (android) : Avoid the grey background before splash screen
How to avoid the dark grey background which will flash for a second before the splash screen appears in android app built by Cordova ?
Solution 1:[1]
This is a simple plugin for Android which will set the window background color for you app's MainActivity to a color of your choice. This allows you to avoid the standard dark grey background which will flash for a second before your splash screen appears. Set the color to the same background as your splash screen for a smoother start-up effect.
cordova plugin add cordova-plugin-android-window-background --variable WINDOW_BACKGROUND_COLOR=#ff69b4 --save
add this to your config.xml file:
<plugin name="cordova-plugin-window-background">
<variable name="WINDOW_BACKGROUND_COLOR" value="#B4D455" />
</plugin>
for more info visit : https://github.com/winteragency/cordova-plugin-android-window-background
Solution 2:[2]
For some reason the plugin 'cordova-plugin-android-window-background' didn't work for me, it closes the application.
This solution provided by @Nsamba Isaac worked like a charm on my phone right now
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | |
Solution 2 | Nacho Cano |