android CheckBox自定义图标

<style name="CustomCheckboxTheme" parent="@android:style/Widget.CompoundButton.CheckBox">
    <item name="android:button">@drawable/checkbox_selector</item>
</style>
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:drawable="@mipmap/checkbox1" android:state_checked="true"/>
    <item android:drawable="@mipmap/checkbox2" android:state_checked="false"/>
    <item android:drawable="@mipmap/checkbox2"/>
</selector>
<CheckBox
    android:id="@+id/cb_status"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    style="@style/CustomCheckboxTheme"/>
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。