Ionic splash screen not loading

回眸只為那壹抹淺笑 提交于 2019-12-02 08:48:07
  1. go to: /usr/local/lib/node_modules/ionic/node_modules/ionic-app-lib/lib/resources.js
  2. change cacheImages property to false
  3. remove android platform
  4. re-add android platform
  5. regenerate resources

And in config.xml make sure the code is configured as follows:

<icon src="resources/android/icon/drawable-ldpi-icon.png" density="ldpi"/>
<splash src="resources/android/splash/drawable-port-xxxhdpi-screen.png" density="port-xxxhdpi"/>
<preference name="SplashScreen" value="screen"/>

You need to change the <platform> section to have file names as screen.png as shown below. Your path for screen.png is incorrect Whenever you use any name for SplashScreen other than splash you need to update the config: https://cordova.apache.org/docs/en/3.1.0/cordova/splashscreen/splashscreen.html#android

<platform name="android">

  <splash src="platform-resources/android/res/drawable-ldpi/screen.png" density="ldpi" />

  <splash src="platform-resources/android/res/drawable-mdpi/screen.png" density="mdpi" />

  <splash src="platform-resources/android/res/drawable-hdpi/screen.png" density="hdpi" />

  <splash src="platform-resources/android/res/drawable-xhdpi/screen.png" density="xhdpi" />

  <splash src="platform-resources/android/res/drawable-xxhdpi/screen.png" density="xxhdpi" />
</platform>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!