仅记录工作和学习中遇到的问题点,方便追溯,同时分享给有需要的小伙伴,如有错误,欢迎指出!
(问题之一)RecycleView滑动item间距变大问题:
现象:进入页面显示的布局很正常,滑动一下页面,所有的item下面都有一大片空白,每个item占用了一个屏幕。
原因:item的根布局layout_height属性设置成了“match_parent”,修改成“wrap_content”即可。
根布局代码如下:
<android.support.constraint.ConstraintLayout
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"
android:layout_marginBottom="16dp"
android:layout_marginRight="16dp"
android:id="@+id/itemMoreRecommendPlayCl">