自分のプロジェクトでカスタムコンポーネントを使用したいと思います。下のような列挙型属性に追加したいのですが、どうすればいいですか?カスタムXML属性としてEnumを使用する
<com.abb.abbcustomcompanents.buttons.AbbButton
android:id="@+id/abbBtn1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:Type="How can i use enum here"
/>
<?xml version="1.0" encoding="utf-8"?>
<resources>
<declare-styleable name="abbButton">
<attr name="Type" format="enum"/>
<attr name="onAction" format="string"/>
</declare-styleable>
</resources>
ありがとうございます!
これをチェックしてください。http://stackoverflow.com/a/15231645/1329126 –
ありがとうございました。あなたが答えとしてそれを書くなら、私はそれを受け入れたものとしてマークすることができます。 – Talha