1. 效果预览
2. 在布局文件中放置 ListView 控件
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<ListView
android:id="@+id/listView"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</LinearLayout>
3. 创建 ListView 的 item 布局
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:an