工具 Android studio。
废话不多说直接上代码:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="#d8e0e8"> <!--android:layout_height="match_parent" 必须设置为 match_parent -->
<android.support.v7.widget.RecyclerView
android:id="@+id/recyclerv"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"> <!--android:layout_weight="1" 关键比例设置为1
android:layout_height="wrap_content" 必须设置为wrap_conte