I defined a rectangle that can be made as follows:
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:radius="4dip"/>
<solid android:color="#FF000000" />
<stroke android:width="1dip" android:color="@color/service_checkbox_disabled_unchecked_stroke" />
</shape>
I can display drawble as an imageView without any problems. However, it is assumed that it will be used for a single flag state. My switch for the checkbox button is defined as follows:
<selector xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:state_checked="true" android:drawable="@drawable/bg_services_tick_unchecked_disabled" />
<item android:state_checked="false" android:drawable="@drawable/bg_services_tick_unchecked_disabled" />
</selector>
And finally, my checkbox:
<CheckBox
android:id="@+id/cb_tariff_3_next_month_checkbox"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:button="@drawable/checkbox_services"
android:layout_centerHorizontal="true"/>
Can anyone say why this is not working? Thank you very much.
source
share