目前遇到两种原因
1.itemlayout里的高度设置为match_parent
解决方法:将match_parent改为wrap_content
2.ScrollView嵌套了recyclerView
解决方法:在recyclerView外面套一个RelativeLayout,并且在recyclerView里添加属性:android:nestedScrollingEnabled="false"
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<androidx.recyclerview.widget.RecyclerView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:layout_marginTop="15dp"
android:layout_marginRight="15dp"
android:nestedScrollingEnabled="false"></androidx.recyclerview.widget.RecyclerView>
</RelativeLayout>
版权声明:本文为qq_33339175原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。