0

I want to increase the size of the check in the checkbox. I am thinking that I add an image for a new check. But I don't see any options in XML to change the check for the checkbox. Is there an XML option I am missing or a way to add the new check image to java.

Sam
  • 7,252
  • 16
  • 46
  • 65
Aaron
  • 4,380
  • 19
  • 85
  • 141

2 Answers2

1
<?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:drawable="@drawable/checkbox" android:state_checked="false"/>
<item android:drawable="@drawable/checkboxselected" android:state_checked="true"/>
<item android:drawable="@drawable/checkbox"/>    

Add it to your check box in xml

 <CheckBox
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                **android:button="@drawable/checkbox_selector"**
                android:text="CheckBox"
                android:textAppearance="?android:attr/textAppearanceLarge"
                android:textColor="@color/Black" />
Bhaskar
  • 911
  • 6
  • 18
0

You can change the checkbox Drawable by setting android:button of the CheckBox.

See this answer for more information on how to create your Drawable: https://stackoverflow.com/a/17647520/379245

Community
  • 1
  • 1
BVB
  • 5,380
  • 8
  • 41
  • 62