您好, 欢迎来到 !    登录 | 注册 | | 设为首页 | 收藏本站

更改Android Checkbox的已选中和未选中图标

更改Android Checkbox的已选中和未选中图标

混合种类:

在您的布局文件中设置它:

 <Check@R_135_2419@ android:layout_width="wrap_content"
           android:layout_height="wrap_content" 
           android:text="new check@R_135_2419@"
           android:background="@drawable/check@R_135_2419@_background" 
           android:button="@drawable/check@R_135_2419@" />

@ drawable / check@R_135_2419@如下所示:

<?xml version="1.0" encoding="utf-8"?>

<selector xmlns:android="http://schemas.android.com/apk/res/android">
 <item android:state_checked="true" android:state_focused="true"
  android:drawable="@drawable/check@R_135_2419@_on_background_focus_yellow" />
 <item android:state_checked="false" android:state_focused="true"
  android:drawable="@drawable/check@R_135_2419@_off_background_focus_yellow" />
 <item android:state_checked="false"
  android:drawable="@drawable/check@R_135_2419@_off_background" />
 <item android:state_checked="true"
  android:drawable="@drawable/check@R_135_2419@_on_background" />
</selector>
其他 2022/1/1 18:19:25 有486人围观

撰写回答


你尚未登录,登录后可以

和开发者交流问题的细节

关注并接收问题和回答的更新提醒

参与内容的编辑和改进,让解决方法与时俱进

请先登录

推荐问题


联系我
置顶