0

I have a custom checkbox with no border and custom background:

<CheckBox
    android:id="@+id/ricordami"
    android:layout_width="25dp"
    android:layout_height="25dp"
    android:layout_gravity="center_vertical"
    android:background="@color/gray"
    android:button="@android:color/transparent" />

but when i launch my app, checkbox on click doesn't show check flag. How can i fix it?

giozh
  • 9,868
  • 30
  • 102
  • 183
  • I don't know how you want the checkbox looks like but you've set the transparent color for "button" property, so your button won't be visible. If you remove that "button" property you'll see that the checkmark will be displayed and the background will be gray. If you want a custom checkbox (using your checkmark image) you have to create a selector indicating the style for every state of the checkbox. Here is link that maybe can help you how to create that selector: [link](http://stackoverflow.com/questions/3965484/custom-checkbox-image-android) – David Rauca Aug 27 '15 at 08:56
  • i want a checkbox without border and with my custom backgrount. The style of checkmark should be the default – giozh Aug 27 '15 at 09:19

0 Answers0