美文网首页
android CheckBox自定义图标

android CheckBox自定义图标

作者: MacLi | 来源:发表于2020-04-24 10:42 被阅读0次
<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"/>

相关文章

网友评论

      本文标题:android CheckBox自定义图标

      本文链接:https://www.haomeiwen.com/subject/fatnbctx.html