PhoneGap Android:如何强制应用程序使用资产www es 中的图标而不是 resdrawable 文件夹? [英] PhoneGap Android: How to force Application to use icons from assetwww es instead resdrawable folder?

查看:36
本文介绍了PhoneGap Android:如何强制应用程序使用资产www es 中的图标而不是 resdrawable 文件夹?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 eclipse 创建了新的 Android phonegap 项目,并将我现有的 iphone phonegap 项目的 WWW 文件夹放入.

I have created new Android phonegap project using eclipse and put my existing WWW folder of my iphone phonegap project.

我在 Android 文件夹中为 Android 设备添加了所有图标和屏幕,如下所示.. 并将其添加到我的 config.xml

I have all the icons and screen added for android device inside Android folder as show here.. and also added it to my config.xml

对于 HDPI,我有以下图标和屏幕.

For HDPI I have following icon and screen.

assetswww esiconandroidicon-72-hdpi.png

assetswww esscreenandroidscreen-hdpi-portrait.png

当我在模拟器中运行应用程序时,它一直显示默认的 PhoneGap 图标和启动画面.

When I run the application in Emulator, it keep showing the default PhoneGap icons and splash screen.

我为 LDIP、MDPI、HDPI、XHDPI 添加了图标和屏幕.

I have added icons and screens for LDIP, MDPI, HDPI, XHDPI.

这是我的 config.xml

here is my config.xml

   <icon src="icon.png" />
<icon src="res/icon/android/icon-36-ldpi.png"   gap:platform="android"    gap:density="ldpi" />
<icon src="res/icon/android/icon-48-mdpi.png"   gap:platform="android"    gap:density="mdpi" />
<icon src="res/icon/android/icon-72-hdpi.png"   gap:platform="android"    gap:density="hdpi" />
<icon src="res/icon/android/icon-96-xhdpi.png"  gap:platform="android"    gap:density="xhdpi" />

我需要设置什么来使用 assetswww es 文件夹而不是默认的 Eclipse EclipseProjectRoot esdrawable 文件夹?

Is there anything I need to set to use assetswww es folder instead of the default eclipse EclipseProjectRoot esdrawable folder ?

谢谢

推荐答案

config.xml 仅供 PhoneGap Build 服务使用.

- 在本地构建,此文件将被忽略并使用 res/drawable 目录中的文件.
- 使用 PGBuild 构建,该服务会在您项目的根目录(在 index.html 旁边)查找此文件,并使用它来确定应将哪些图像复制到 res/drawable 文件夹的末尾以生成具有正确权限的 apk图像(在 Android 的情况下).

由于 PGBuild 为许多平台构建,config.xml 是他们在 html/js/css 之外提供尽可能多的自定义功能的方式.其中一些只是为了为每个平台选择您的图标/启动图像,但您也可以做更多的事情.PGBuild 根据上传文件的内容为每个平台执行每个本机所需的操作.

config.xml is used only by the PhoneGap Build service.

- Building locally, this file is ignored and the files in your res/drawable directory are used.
- Building with PGBuild, the service looks for this file at the root of your project (next to index.html) and uses it to identify what images should be copied into the res/drawable folder on their end to generate an apk with the right images (in the case of Android).

Since PGBuild builds for a lot of platforms, config.xml is their way of offering as much customisation capabilites as they can outside of the html/js/css. Some of this is just for picking your icons/splash images for each platform but you can do a lot more with too. PGBuild does each of the natively required actions for each platform based on the contents of the uploaded file.

我希望这足够清楚.

这篇关于PhoneGap Android:如何强制应用程序使用资产www es 中的图标而不是 resdrawable 文件夹?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆