<declare-styleable>の中の<attr>のformat

<attr>のformatで変数の型を指定できる。
いろいろあるけど、文字列、整数値、に加えて色を定義していこう。
styles.xmlで、

customColorのformatは"color"なので、16進数で#ffffff00と書く。
黄色である。
activity_main.xmlで、

TextViewのbackgroundにcustomColorを指定。

こうなった
こうなった

こうなった。

Sample/android/declare-styleableTag/attrTag_format/src/declare-styleableTag at master · bg1bgst333/Sample · GitHub