Ionic (PHONEGAP)-After packaging app startup interface disappears black screen
tags (space delimited): Ionic splashscreen Community Questions
StackOverflow
$ Ionic Resources
or
$ ionic--icon # #单独生成应用图标
$ ionic Resources--splash # # Individual build should start picture
Ionic will upload your icon to its server and then return to you, so must be able to surf the Internet, note: The icon must be. Png,.psd.ai cannot be changed
by another icon. After successful execution, the code will be generated under your Config.xml:
Add SplashScreen plugin
But you may find that your splash screen is not, may be black a bit to the application, no matter how you change your config.xml is no effect, after several toss found the solution:
$ Cordova Plugin Add Cordova-plugin-splashscreen
Configure Config.xml
# #默认只有SplashScreen和SplashScreenDelay
<preference name= "SplashScreen" value= "screen"/>
< Preference name= "Splashscreendelay" value= "10000"/> #显示时间 <preference name= "Autohidesplashscreen"
False "/> #禁止自动隐藏
<preference name=" Auto-hide-splash-screen "value=" false "/> #禁止自动隐藏
< Preference name= "Fadesplashscreen" value= "false"/> #禁用淡出效果 <preference name=
"Splashmaintainaspectratio" Value= "true"/> #图像cover屏幕
<preference name= "Showsplashscreenspinner" value= "false"/> #隐藏加载灰圈
< Preference name= "Splashshowonlyfirsttime" value= "false"/> #每次重新启动都显示
App.js
Document.addeventlistener ("Deviceready", Ondeviceready, false);
function Ondeviceready () {
navigator.splashscreen.hide ();
}
If you are using Ionic, add
navigator.splashscreen.hide () directly in the. Run ().