<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.CardView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/cv"
android:foreground="?android:attr/selectableItemBackground">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="1dp"
>
<ImageView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="false"
android:id="@+id/person_photo"
android:src="@drawable/nature"
android:adjustViewBounds="true"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/person_name"
android:layout_below="@+id/person_photo"
android:textSize="30sp"
android:text="THE TITLE"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/person_age"
android:layout_below="@+id/person_name"
android:text="Then the text"
/>
</RelativeLayout>
</android.support.v7.widget.CardView>
从 ArrayList 中提取数据,从SQLite数据库中提取数据,我想知道如何让用户为任何特定的 cardview选择他/她自己的图像?
答案 0 :(得分:0)
在适配器类中为cardview设置onclicklistener