lundi 4 mai 2020

Change Android CheckBox icon check/unchecked

I am new at Android. I am trying to change the icon of the CheckBox.

Here is my code, where star_checked and start_unchecked are .png file in my drawable.

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

I am getting the following error: C:...\app\src\main\res\drawable\selector_priority.xml:3: AAPT: error: '=@drawable/star_checked' is incompatible with attribute drawable (attr) reference.

Any idea of what the issue could be?

Thanks in advance




Aucun commentaire:

Enregistrer un commentaire