Icon and splash screen for Cordova Project __cordova

Source: Internet
Author: User

The Config.xml file in the

Phonegap/cordova project, which has the following contents configured:


<icon gap:platform="android" gap:qualifier="ldpi" src="res/icon/android/icon-36-ldpi.png" />
<icon gap:platform="android" gap:qualifier="mdpi" src="res/icon/android/icon-48-mdpi.png" />
<icon gap:platform="android" gap:qualifier="hdpi" src="res/icon/android/icon-72-hdpi.png" />
<icon gap:platform="android" gap:qualifier="xhdpi" src="res/icon/android/icon-96-xhdpi.png" />
<icon gap:platform="blackberry" src="res/icon/blackberry/icon-80.png" />
<icon gap:platform="blackberry" gap:state="hover" src="res/icon/blackberry/icon-80.png" />
<icon gap:platform="ios" height="57" src="res/icon/ios/icon-57.png" width="57" />
<icon gap:platform="ios" height="72" src="res/icon/ios/icon-72.png" width="72" />
<icon gap:platform="ios" height="114" src="res/icon/ios/icon-57-2x.png" width="114" />
<icon gap:platform="ios" height="144" src="res/icon/ios/icon-72-2x.png" width="144" />
<icon gap:platform="webos" src="res/icon/webos/icon-64.png" />
<icon gap:platform="winphone" src="res/icon/windows-phone/icon-48.png" />
<icon gap:platform="winphone" gap:role="background" src="res/icon/windows-phone/icon-173.png" />
<gap:splash gap:platform="android" gap:qualifier="port-ldpi" src="res/screen/android/screen-ldpi-portrait.png" />
<gap:splash gap:platform="android" gap:qualifier="port-mdpi" src="res/screen/android/screen-mdpi-portrait.png" />
<gap:splash gap:platform="android" gap:qualifier="port-hdpi" src="res/screen/android/screen-hdpi-portrait.png" />
<gap:splash gap:platform="android" gap:qualifier="port-xhdpi" src="res/screen/android/screen-xhdpi-portrait.png" />
<gap:splash gap:platform="blackberry" src="res/screen/blackberry/screen-225.png" />
<gap:splash gap:platform="ios" height="480" src="res/screen/ios/screen-iphone-portrait.png" width="320" />
<gap:splash gap:platform="ios" height="960" src="res/screen/ios/screen-iphone-portrait-2x.png" width="640" />
<gap:splash gap:platform="ios" height="1136" src="res/screen/ios/screen-iphone-portrait-568h-2x.png" width="640" />
<gap:splash gap:platform="ios" height="1024" src="res/screen/ios/screen-ipad-portrait.png" width="768" />
<gap:splash gap:platform="ios" height="768" src="res/screen/ios/screen-ipad-landscape.png" width="1024" />
<gap:splash gap:platform="winphone" src="res/screen/windows-phone/screen-portrait.jpg" />


This res/icon and Res/screen directory is relative to the PHONEGAP project directory, which is similar to Phonegap/res/icon/android/icon-36-ldpi.png, your icon and splash screen must be in both directories.



phonegap3.5 the previous Config.xml src= "res/...", phonegap3.5 began to src= "www/res/..." and the actual icon and splash file are all present under the www/res of the. Therefore, phonegap3.4 does not apply the icon and splash screen is justifiable (because the path does not specify the right).



However, although the SRC changed to "www/res/...", we also put our own icon and splash file in the phonegap/www/res/... Under



But the last build after the Android project and the iOS project, icon and splash screen is still not our own.



Later, I looked at the Cordova document and made some modifications to Config.xml before I was able to configure it successfully.



1, remove the above Config.xml icon and splash screen configuration, change to the following


<platform name="android">
  <icon src="res/icon/android/icon-36-ldpi.png" density="ldpi" />
  <icon src="res/icon/android/icon-48-mdpi.png" density="mdpi" />
  <icon src="res/icon/android/icon-72-hdpi.png" density="hdpi" />
  <icon src="res/icon/android/icon-96-xhdpi.png" density="xhdpi" />
  <splash src="res/screen/android/splash-land-hdpi.png" density="land-hdpi"/>
  <splash src="res/screen/android/splash-land-ldpi.png" density="land-ldpi"/>
  <splash src="res/screen/android/splash-land-mdpi.png" density="land-mdpi"/>
  <splash src="res/screen/android/splash-land-xhdpi.png" density="land-xhdpi"/>
  <splash src="res/screen/android/splash-port-hdpi.png" density="port-hdpi"/>
  <splash src="res/screen/android/splash-port-ldpi.png" density="port-ldpi"/>
  <splash src="res/screen/android/splash-port-mdpi.png" density="port-mdpi"/>
  <splash src="res/screen/android/splash-port-xhdpi.png" density="port-xhdpi"/>
</platform>
<platform name="ios">
  <icon src="res/icon/ios/icon-60@3x.png" width="180" height="180" />
  <icon src="res/icon/ios/icon-60.png" width="60" height="60" />
  <icon src="res/icon/ios/icon-60@2x.png" width="120" height="120" />
  <icon src="res/icon/ios/icon-76.png" width="76" height="76" />
  <icon src="res/icon/ios/icon-76@2x.png" width="152" height="152" />
  <icon src="res/icon/ios/icon-40.png" width="40" height="40" />
  <icon src="res/icon/ios/icon-40@2x.png" width="80" height="80" />
  <icon src="res/icon/ios/icon.png" width="57" height="57" />
  <icon src="res/icon/ios/icon@2x.png" width="114" height="114" />
  <icon src="res/icon/ios/icon-72.png" width="72" height="72" />
  <icon src="res/icon/ios/icon-72@2x.png" width="144" height="144" />
  <icon src="res/icon/ios/icon-small.png" width="29" height="29" />
  <icon src="res/icon/ios/icon-small@2x.png" width="58" height="58" />
  <icon src="res/icon/ios/icon-50.png" width="50" height="50" />
  <icon src="res/icon/ios/icon-50@2x.png" width="100" height="100" />
  <splash src="res/screen/ios/Default~iphone.png" width="320" height="480"/>
  <splash src="res/screen/ios/Default@2x~iphone.png" width="640" height="960"/>
  <splash src="res/screen/ios/Default-Portrait~ipad.png" width=&

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.