当我检查您的问题图像时,您的 RecyclerView 项目布局已占据每个项目的整个屏幕高度。问题是你将 Cardview 的layout_ height设置为“match_parent”,这就是为什么它需要全高。
这里需要改变的是,
<androidx.cardview.widget.CardView 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="wrap_content"> <!-- here you need to change wrap_content-->
...
...
</androidx.cardview.widget.CardView>