This is the checkbox I have and I see it correctly on the preview pane.
<CheckBox
android:id="@+id/cbCheck"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:button="@drawable/custom_checkbox"
android:checked="false"
android:padding="10dp"
android:layout_marginLeft="10dp"
android:layout_marginStart="10dp"
android:text="@string/will_wait"
android:layout_alignTop="@+id/txtLeave"
android:layout_alignBottom="@+id/txtLeave"
android:layout_toEndOf="@+id/txtLeave"
android:layout_toRightOf="@+id/txtLeave" />
custom_checkbox is this:
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://ift.tt/nIICcg">
<item android:state_checked="true" android:drawable="@drawable/custom_checkbox_checked"/>
<item android:state_checked="false" android:drawable="@drawable/custom_checkbox_unchecked"/>
</selector>
checked:
<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns:android="http://ift.tt/nIICcg" android:shape="rectangle">
<gradient android:startColor="#ffffffff" android:endColor="#0000ff" android:angle="270"/>
<stroke android:width="4px" android:color="#90caf9" />
<size android:height="20dp" android:width="20dp"/>
</shape>
unchecked:
<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns:android="http://ift.tt/nIICcg" android:shape="rectangle">
<gradient android:startColor="#ffffffff" android:endColor="#ffffffff" android:angle="270"/>
<stroke android:width="4px" android:color="#90caf9" />
<size android:height="20dp" android:width="20dp"/>
</shape>
While I see it correctly on the preview:
on my device the text is gone. When I tap the "empty" space, the checkbox changes state correctly but the text is just not there. I thought it's a coloring issue but I only touch the button, not the text.
Aucun commentaire:
Enregistrer un commentaire