0

AndroidManifest.xmlに次のものがあります

<application
            android:icon="@drawable/icon"
            android:label="@string/app_name"
            android:name=".MonamiqApplication"
            android:theme="@style/monamiq_theme">

これは機能しますが、代わりにこれに属性を使用したいのですが、これはアプリのアイコンで可能ですか? app_iconを定義したカスタムテーマを使用しています

使いたい

<application
            android:icon="?app_icon"
            android:label="@string/app_name"
            android:name=".MonamiqApplication"
            android:theme="@style/monamiq_theme">

attr.xml

<?xml version="1.0" encoding="utf-8"?>
<resources> 
    <attr name="app_icon" format="reference" />
</resources>

monamiq_theme.xml

<resources>
    <style name="monamiq_theme" parent="android:Theme.Holo.Light" >
        <item name="app_icon">@drawable/icon</item>
    </style>

4

1 に答える 1

0

新しいアイコンをドローアブル フォルダーに配置し、プロジェクトをクリーンアップして、@drawable/your_image で使用します。デフォルトを置き換えるだけです。

于 2013-08-19T12:46:06.353 に答える