- item.xml布局中的layout_height不能为match_parent,应设为wrap_content
android:layout_height="wrap_content"
- main.xml布局中的layout_height不能为match_parent,应设为wrap_content
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rvUser"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp" />
以上。
附(第一行代码中的一段话):