build.phonegap adding splash screens

2019-09-06 09:10发布

I'm using the Ionic framework and build.phonegap to build an application for Android and IOS and having a bit of trouble with the process of adding splash screens to the application.

There are quite a few tutorials to create splash screens after running "ionic build android" or "cordova build android" and then adding the splash screens, but I would like to use ONLY the www folder inside of ionic and push it through phonegap build.

Is there a way / directory I can add the splash screen images to and reference them through config.xml? Then upload the whole www folder to build.phonegap.

Some guidance would be appreciated.

1条回答
爷的心禁止访问
2楼-- · 2019-09-06 09:30

With Phonegap Build, you can put the splash screens pretty much anywhere you want, as long as you reference them in the config.xml.

For example, with Android:

<gap:splash src="splash.png" />
<gap:splash src="images/splash/splash-portrait-320x480.png" gap:platform="android" gap:density="ldpi" />
<gap:splash src="images/splash/splash-portrait-640x960.png" gap:platform="android" gap:density="mdpi" />
<gap:splash src="images/splash/splash-portrait-640x1136.png" gap:platform="android" gap:density="hdpi" />
<gap:splash src="images/splash/splash-portrait-1536x2008.png" gap:platform="android" gap:density="xhdpi" />
<gap:splash src="images/splash/splash-portrait-1536x2008.png" gap:platform="android" gap:density="xxhdpi" />

Notice you must have a default splash.png and it MUST be in the ROOT (WWW, whereever your config file is).

See also their documentation: http://docs.build.phonegap.com/en_US/configuring_icons_and_splash.md.html#Icons%20and%20Splash%20Screens

查看更多
登录 后发表回答