PhoneGap显示默认图标而不是我的图标

时间:2018-10-01 14:34:44

标签: cordova phonegap-build phonegap

我的config.xmlindex.html和我的图标都在根目录下,但是PhoneGap不显示我的图标。它显示了默认的PhoneGap内置图标。

这是我的config.xml(我从www/中删除了src,但仍然没有显示):

<icon src="www/icon.png" gap:platform="ios" width="57" height="57" />
<icon src="www/icon-60.png" gap:platform="ios" width="60" height="60" />
<icon src="www/icon-60@2x.png" gap:platform="ios" width="120" height="120" />
<icon src="www/icon@2x.png" gap:platform="ios" width="114" height="114" />
<!-- iPad -->
<icon src="www/icon-72.png" gap:platform="ios" width="72" height="72" />
<icon src="www/icon-72@2x.png" gap:platform="ios" width="144" height="144" />
<icon src="www/icon-76.png" gap:platform="ios" width="76" height="76" />
<icon src="www/icon-76@2x.png" gap:platform="ios" width="152" height="152" />

<!-- Settings Icon -->
<icon src="www/icon-small.png" gap:platform="ios" width="29" height="29" />
<icon src="www/icon-small@2x.png" gap:platform="ios" width="58" height="58" />
<icon src="www/icon-50.png" gap:platform="ios" width="50" height="50" />
<icon src="www/icon-50@2x.png" gap:platform="ios" width="100" height="100" />

<!-- Spotlight Icon -->
<icon src="www/icon-40.png" gap:platform="ios" width="40" height="40" />
<icon src="www/icon-40@2x.png" gap:platform="ios" width="80" height="80" />

1 个答案:

答案 0 :(得分:0)

您不应将所有图标放在www根文件夹中。为资源创建一个子文件夹,假设为res,然后为图标创建一个子文件夹,例如为icon(因为您可以拥有其他资源,例如启动画面)。最后,为每个平台创建一个子文件夹(例如iosandroid)。现在,在config.xml中,不要使用旧的gap:platform="ios"。而是按平台将所有图标分组:

<platform name="ios">
    <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-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-small@3x.png" width="87" height="87" />
    <icon src="res/icon/ios/icon-small-40.png" width="40" height="40" />
    <icon src="res/icon/ios/icon-small-40@2x.png" width="80" height="80" />
    <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" />
    <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-60@3x.png" width="180" height="180" />
    <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-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-83.5@2x.png" width="167" height="167" />
    <splash src="res/splash/ios/Default~iphone.png" width="320" height="480"/>
    <splash src="res/splash/ios/Default@2x~iphone.png" width="640" height="960"/>
    <splash src="res/splash/ios/Default-Portrait~ipad.png" width="768" height="1024"/>
    <splash src="res/splash/ios/Default-Portrait@2x~ipad.png" width="1536" height="2048"/>
    <splash src="res/splash/ios/Default-Landscape~ipad.png" width="1024" height="768"/>
    <splash src="res/splash/ios/Default-Landscape@2x~ipad.png" width="2048" height="1536"/>
    <splash src="res/splash/ios/Default-568h@2x~iphone.png" width="640" height="1136"/>
    <splash src="res/splash/ios/Default-667h.png" width="750" height="1334"/>
    <splash src="res/splash/ios/Default-736h.png" width="1242" height="2208"/>
    <splash src="res/splash/ios/Default-Landscape-736h.png" width="2208" height="1242"/>
</platform>