我有一个应用程序,我在gridview中显示一些信息。现在我需要将相同的功能添加到同一gridview。请帮我解决一下这个。我试过谷歌搜索,但没有运气。
答案 0 :(得分:0)
您可以在gridview项目
中使用收藏夹的自定义复选框这是复选框的代码
<CheckBox
android:id="@+id/checkbox_favorite"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:button="@drawable/customdrawablecheckbox"
android:layout_marginLeft="10dp"/>
这里是自定义drawable的代码
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_checked="false" android:drawable="@drawable/ic_action_favorite" />
<item android:state_checked="true" android:drawable="@drawable/ic_action_favoritecheck" />
<item android:drawable="@drawable/ic_action_favorite" />