Cordova 3.4 Splashscreen not working

雨燕双飞 提交于 2019-12-05 12:39:23

I'm using cordova v3.6.3 in my android project.

I read a API & Plugin Documentations but, I confused the some options in config. but, I found a perfect solution.

1. above all, you don't need to use "navigator.splashscreen.hide()" or ".show()" in Android project.

2. refer my directory structure for understanding clearly.

3. Add following codes into your config.xml file. ※ Do not change the value="screen". you just change the src and delay value for your splashscreen image.

[Config.xml]

<platform name="android">
    <splash src="www/res/screen/android/screen-default.png" />
</platform>
<preference name="SplashScreen" value="screen" />
<preference name="SplashScreenDelay" value="4000" />

4. delete a "screen.png" file from drawable directory for understanding clearly.

5. build your project on your command line (cordova build android) and, look again drawable directory.

I'll promise, you'll success. :-)

I was having the same issue after the 2.5.1 CLI update. If i run the same project in the VisualStudio ionic simulator all works fine. It also works fine when I run the app in the bowser with Telerik Platform. I just need to comment out navigator.splashscreen.hide(); in my project for the latest CLI simulator or I just get a plain white screen. James

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!