2016-11-27 11 views
0

config.xmlファイルで自分のアプリアイコンを変更しようとしています。私はw3.orgの文書を読んでいます。私はこのコードを十分に書かなければなりません。アンドロイドコードバーアイコンを変更できません

<platform name="android"> 
    <icon src="res/icon/logo.png" /> 
</platform> 

は、しかし、私は、これは失敗しており、それがない作品行います

CVC-複雑-type.2.4.aを:無効なコンテンツが見つかった 要素 'アイコン' で始まります。許可-意図、 "のhttp:// www.w3.org/ns/widgets":allow-navigation、 " http://www.w3.org/ns/widgets ":プラグイン、 " http://www.w3.org/ns/widgets ":好み、" HTTP:「{ "http://www.w3.org/ns/widgets" の一つ// www.w3.org/ns/widgets":hook} 'が必要です。

ので、私はこの方法のように、それを試してみてください。

<platform name="android"> 
     <allow-intent href="market:*" /> 
     <allow-intent href="http://www.w3.org/ns/widgets"/> 
     <allow-navigation href="http://www.w3.org/ns/widgets"/> 
     <icon src="res/icon.png" /> 
</platform> 

、エラーがあること保ちます。 これは私の完全なconfig.xmlのコードです:

<?xml version='1.0' encoding='utf-8'?> 
<widget id="tta.kirolapp.v1" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0"> 
    <name>Kirol App v1</name> 
    <description> 
     A sample Apache Cordova application that responds to the 
     deviceready 
     event. 
    </description> 
    <author email="[email protected]" href="http://www.eclipse.org/thym"> 
     Eclipse.org - Thym 
    </author> 
    <content src="index.html" /> 
    <plugin name="cordova-plugin-whitelist" spec="1" /> 
    <access origin="*" /> 
    <allow-intent href="http://*/*" /> 
    <allow-intent href="https://*/*" /> 
    <allow-intent href="tel:*" /> 
    <allow-intent href="sms:*" /> 
    <allow-intent href="mailto:*" /> 
    <allow-intent href="geo:*" /> 

    <platform name="android"> 
     <allow-intent href="market:*" /> 
     <allow-intent href="http://www.w3.org/ns/widgets"/> 
     <allow-navigation href="http://www.w3.org/ns/widgets"/> 
     <icon src="res/icon.png" /> 
    </platform> 
    <platform name="ios"> 
     <allow-intent href="itms:*" /> 
     <allow-intent href="itms-apps:*" /> 
    </platform> 
    <engine name="android" spec="6.1.0" /> 
    <preference name="Orientation" value="portrait" /> 


</widget> 

コンフィグxmlファイル: enter image description here

+0

pngの代わりにjpgファイルを試してください.... –

+0

これは問題ではありません。 – Asier

答えて

0

それは

<platform name="android"> 
    <!-- 
     ldpi : 36x36 px 
     mdpi : 48x48 px 
     hdpi : 72x72 px 
     xhdpi : 96x96 px 
     xxhdpi : 144x144 px 
     xxxhdpi : 192x192 px 
    --> 
    <icon src="res/android/ldpi.png" density="ldpi" /> 
    <icon src="res/android/mdpi.png" density="mdpi" /> 
    <icon src="res/android/hdpi.png" density="hdpi" /> 
    <icon src="res/android/xhdpi.png" density="xhdpi" /> 
    <icon src="res/android/xxhdpi.png" density="xxhdpi" /> 
    <icon src="res/android/xxxhdpi.png" density="xxxhdpi" /> 
</platform> 

ようにする必要がありますがより多くのプラットフォームで詳細な情報については、Cordova Docsを見て

+0

なぜこれで足りないのですか? Asier

+0

アンドロイドにはさまざまなサイズが用意されていますので、アイコンのサイズを指定する必要があります。 [複数の画面をサポート](https://developer.android.com/guide/practices/screens_support.html)をご覧ください –

+0

これらの行を使用すると、Eclipseにエラー "複数行の注釈が見つかりました: \t - cvc-複合型.2.4.a:要素 'icon'で始まる無効なコンテンツが見つかりました。 '{"http://www.w3.org/ns/widgets":allow-intent、 \t" http:// www.w3.org/ns/widgets":allow-navigation、 "http://www.w3.org/ns/widgets":plugin"、 "http://www.w3.org/ns/widgets":preference \t "http://www.w3.org/ns/widgets"hook}"が期待されます \t - cvc-complex-type.3.2.2:属性 'density'は要素 'アイコン'。" – Asier

関連する問題