2021-08-23から1日間の記事一覧

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

<attr>のformatで変数の型を指定できる。 いろいろあるけど、文字列、整数値、に加えて色を定義していこう。 styles.xmlで、customColorのformatは"color"なので、16進数で#ffffff00と書く。 黄色である。 activity_main.xmlで、TextViewのbackgroundにcustomColor</attr>…