我已经尝试了一些时间,但仍然是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"/>
答案 0 :(得分:1)
实际上,手机屏幕仍然存在加载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" />
答案 1 :(得分: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。
答案 2 :(得分:0)
截至8月17日显然已修复:https://github.com/phonegap/build/issues/9
一半适合我,有一个更好的图标显示但似乎是使用hdpi图标?