xmlns:android=“http://schemas.android.com/apk/res/android”
xmlns:app=“http://schemas.android.com/apk/res-auto”
xmlns:tools=“http://schemas.android.com/tools”
android:layout_width=“match_parent”
android:layout_height=“match_parent”
android:padding=“10dp”
<LinearLayout
android:layout_width=“match_parent”
android:layout_height=“wrap_content”
android:gravity=“center”
android:orientation=“horizontal”>
<TextView
android:id=“@+id/id”
android:layout_width=“wrap_content”
android:layout_height=“wrap_content”
android:layout_marginLeft=“5dp”
android:layout_weight=“1”
android:text=“id” />
<TextView
android:id=“@+id/name”
android:layout_width=“wrap_content”
android:layout_height=“wrap_content”
android:layout_marginLeft=“5dp”
android:layout_weight=“1”
android:text=“姓名” />
<TextView
android:id=“@+id/age”
android:layout_width=“wrap_content”
android:layout_height=“wrap_content”
android:layout_marginLeft=“5dp”
android:layout_weight=“1”
android:text=“年龄” />
<TextView
android:id=“@+id/address”
android:layout_width=“wrap_content”
android:layout_height=“wrap_content”
android:layout_marginLeft=“5dp”
android:layout_weight=“1”
android:text=“地址” />
<LinearLayout
android:layout_width=“wrap_content”
android:layout_height=“wrap_content”
android:layout_marginLeft=“10dp”
android:layout_weight=“1”
android:layout_gravity=“right”
android:orientation=“horizontal”>
<Button
android:id=“@+id/button”
android:layout_width=“70dp”
android:layout_height=“wrap_content”
android:layout_marginLeft=“10dp”
android:layout_gravity=“right”
android:layout_weight=“1”
android:textSize=“15sp”
android:text=“修改” />
<Button
android:id=“@+id/button4”
android:layout_width=“70dp”
android:layout_height=“wrap_content”
android:layout_gravity=“right”
android:layout_weight=“1”
android:textSize=“15sp”
android:text=“删除” />
2、添加表头的xml,创建list_header.xml
<LinearLayout
xmlns:android=“http://schemas.android.com/apk/res/android”
xmlns:app=“http://schemas.android.com/apk/res-auto”
xmlns:tools=“http://schemas.android.com/tools”
android:layout_width=“match_parent”
android:layout_height=“match_parent”
android:padding=“10dp”
<LinearLayout
android:layout_width=“match_parent”
<