0

我已经尝试了一段时间,但仍然是 xhdpi Android 设备的默认图标。如果我查看 apk,问题是在 res/drawable 和 res/drawable-xhdpi 中仍然使用 Phonegap 默认图标。

我的 config.xml:

<icon src="icon.png" width="96" height="96" />
<icon src="icons/ios/icon.png" width="57" height="57" />
<icon src="icons/ios/icon-72.png" gap:platform="ios" width="72" height="72" />
<icon src="icons/ios/icon_at_2x.png" width="114" height="114" />
<icon src="icons/android/ldpi.png" gap:platform="android" gap:density="ldpi" width="36" height="36"/>
<icon src="icons/android/mdpi.png" gap:platform="android" gap:density="mdpi" width="48" height="48"/>
<icon src="icons/android/hdpi.png" gap:platform="android" gap:density="hdpi" width="72" height="72"/>
<icon src="icons/android/xdpi.png" gap:platform="android" gap:density="xhdpi" width="96" height="96"/>
4

3 回答 3

1

好吧实际上phonegap仍然有加载xhdpi图标的问题。(状态 10/04/14)

解决方法是:

<!-- ldpi --> 
<icon src="resources/images/icons/android/icon-36.png"  gap:platform="android" width="36" height="36" />
<icon src="resources/images/icons/android/icon-48.png"  gap:platform="android" gap:density="ldpi" /> 
<!-- mdpi --> 
<icon src="resources/images/icons/android/icon-48.png"  gap:platform="android" width="48" height="48" /> 
<icon src="resources/images/icons/android/icon-72.png"  gap:platform="android" gap:density="mdpi" /> 
<!-- hdpi --> 
<icon src="resources/images/icons/android/icon-72.png"  gap:platform="android" width="72" height="72" /> 
<icon src="resources/images/icons/android/icon-96.png"  gap:platform="android" gap:density="hdpi" /> 
<!-- xhdpi --> 
<icon src="resources/images/icons/android/icon-96.png"  gap:platform="android" width="96" height="96" /> 
<icon src="resources/images/icons/android/icon-114.png" gap:platform="android" gap:density="xhdpi" />
于 2014-04-14T09:42:30.090 回答
1

首先,您必须尝试错误的文件路径(尝试cordova prepare android --verbose查找错误)。然后按如下方式设置您的文件:

图标:

<icon gap:platform="android" gap:density="ldpi" width="36" height="36" src="www/assets/images/icon/android/ic_launcher_ldpi.png" />
<icon gap:platform="android" gap:density="mdpi" width="48" height="48" src="www/assets/images/icon/android/ic_launcher_mdpi.png" />
<icon gap:platform="android" gap:density="hdpi" width="72" height="72" src="www/assets/images/icon/android/ic_launcher_hdpi.png" />
<icon gap:platform="android" gap:density="xhdpi" width="96" height="96" src="www/assets/images/icon/android/ic_launcher_xhdpi.png" />
<icon gap:platform="android" gap:density="xxhdpi" width="114" height="114" src="www/assets/images/icon/android/ic_launcher_xxhdpi.png" />

溅:

<splash gap:platform="android" gap:density="ldpi" src="www/assets/images/splash/android/screen-ldpi-portrait.png" />
<splash gap:platform="android" gap:density="mdpi" src="www/assets/images/splash/android/screen-mdpi-portrait.png" />
<splash gap:platform="android" gap:density="hdpi" src="www/assets/images/splash/android/screen-hdpi-portrait.png" />
<splash gap:platform="android" gap:density="xhdpi" src="www/assets/images/splash/android/screen-xhdpi-portrait.png" />
<splash gap:platform="android" gap:density="xxhdpi" src="www/assets/images/splash/android/screen-xxhdpi-portrait.png" />

注意:它适用于 phonegap@5.1.1 / cordova@5.3.1。

于 2015-10-28T05:12:20.703 回答
0

显然已于 8 月 17 日修复:https ://github.com/phonegap/build/issues/9

一半对我有用,显示了一个更好的图标,但似乎正在使用 hdpi 图标?

于 2012-09-10T12:56:15.593 回答