문제

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.

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top