Frage

I'm working on an application where I'm using a checkedTextView, it all works great. But I really don't like that layout of the "checkbox" within the checkedTextView, it's simply to big. Is there any way to resize it or change the layout to something custom made?

I've tried the android:checkMark attribute, but that resulted in it being marked all the time, and thus showing all the time.

War es hilfreich?

Lösung

Instead of using a single drawable you should write a selector:

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

And then set it to the android:checkMark attribute.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top