生成iOS和Android的图标科尔多瓦/ PhoneGap的 [英] Generating iOS and Android icons in Cordova / PhoneGap

查看:224
本文介绍了生成iOS和Android的图标科尔多瓦/ PhoneGap的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个新创建的科尔多瓦的项目具有以下的config.xml 设置(从<一个使用的指令href="http://docs.phonegap.com/en/edge/config_ref_images.md.html">http://docs.phonegap.com/en/edge/config_ref_images.md.html).我还添加了2平台(iOS和Android)。

当我运行任科尔多瓦运行IOS 科尔多瓦运行Android ,该项目仍然有默认的科尔多瓦图标。我从文档的理解是,Corodva应该建立自动设在的icon.png 我提供的的config.xml

的config.xml

 &LT; XML版本=1.0编码=UTF-8&GT?;
&LT;微件ID =com.testapp版本=1.1.2的xmlns =htt​​p://www.w3.org/ns/widgets的xmlns:CDV =htt​​p://cordova.apache.org/ns /1.0">
    &LT;名称&gt;&SingleApp LT; /名称&gt;
  &LT; preference名=DisallowOverscroll值=真/&GT;
  &LT; preference名=AutoHideSplashScreen值=FALSE/&GT;
  &LT; preference名=方向值=画像/&GT;
  &LT; preference名=全屏值=FALSE/&GT;
  &LT; preference名=目标设备值=手机/&GT;

  &LT;描述&GT;
      样本的Apache科尔多瓦应用程序响应deviceready事件。
  &LT; /描述&GT;
  &LT;作者电子邮件=dev@cordova.apache.org的href =htt​​p://cordova.io&GT;
      Apache的科尔多瓦队
  &LT; /笔者&GT;
  &LT;内容SRC =的index.html/&GT;
  &LT;获得原产地=*/&GT;

  &LT;图标SRC =的icon.png/&GT;

&LT; /部件&GT;
 

解决方案

我写的自动生成使用ImageMagick的图标科尔多瓦的脚本:

https://github.com/AlexDisler/cordova-icon

要使用它,创建一个的icon.png的文件,并把它放在你的项目的根文件夹,然后运行:

 科尔多瓦图标
 

和它会生成所需的所有图标,为您的项目了。该平台

您也可以将其配置为一个钩子,在科尔多瓦的项目,所以图标将每次构建基于你已经添加了的icon.png项目时生成。 (在自述说明)。

I have a freshly created Cordova project with the following config.xml setup (used the instructions from http://docs.phonegap.com/en/edge/config_ref_images.md.html). I also added 2 platforms (iOS and Android).

When I run either cordova run ios or cordova run android, the project still has the default Cordova icons. My understanding from the documentation is that Corodva is supposed to create the icons automatically based in the icon.png I supplied in the config.xml.

config.xml:

<?xml version='1.0' encoding='utf-8'?>
<widget id="com.testapp" version="1.1.2" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
    <name>SingleApp</name>
  <preference name="DisallowOverscroll" value="true" />
  <preference name="AutoHideSplashScreen" value="false" />
  <preference name="Orientation" value="portrait" />
  <preference name="Fullscreen" value="false" />
  <preference name="target-device" value="handset" />

  <description>
      A sample Apache Cordova application that responds to the deviceready event.
  </description>
  <author email="dev@cordova.apache.org" href="http://cordova.io">
      Apache Cordova Team
  </author>
  <content src="index.html" />
  <access origin="*" />

  <icon src="icon.png" />

</widget>

解决方案

I wrote a script that auto generates icons for cordova using ImageMagick:

https://github.com/AlexDisler/cordova-icon

To use it, create an "icon.png" file and place it in the root folder of your project, then run:

cordova-icon

and it will generate all the required icons for the platforms your project has.

You can also configure it as a hook in your cordova project so the icons will be generated every time you build the project based on the icon.png you've added. (instructions in the readme).

这篇关于生成iOS和Android的图标科尔多瓦/ PhoneGap的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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