21
16

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

AndroidでCheckBoxの色を変更する時の対応

Last updated at Posted at 2016-07-11

適当にstyle適応すれば変わるだろうと思っていたましたが
結構ハマってしまったためメモ
http://endoidou.hatenablog.com/entry/2016/07/12/000826

##CheckBoxの色を変更する
下記パラメータを設定する

  • colorControlNormal
  • colorControlActivated
checkbox_theme.xml
    <style name="MyCheckBox" parent="Theme.AppCompat.Light">
    	<!-- 枠線 -->
        <item name="colorControlNormal">@color/green</item>
        <!-- チェック時の色 -->
        <item name="colorControlActivated">@color/blue</item>
    </style>
activity_main.xml
    <CheckBox
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="with theme"
        android:theme="@style/MyCheckBox"/>

Screenshot_20160712-001404.png

##注意

	style="@style/MyCheckBox"

と書くと反映されないため注意

21
16
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
21
16

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?