Android5.0之后如果使用ScrollView嵌套RecyclerView,那么RecyclerView将只显示第一行,后面部分要滑动才会出现,但此时滑动的只有RecyclerView部分而不是整个ScrollView。解决办法是在RecyclerView外面嵌套一层RelativeLayout,即:
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:descendantFocusability="blocksDescendants">
<!--中间补充RecyclerView-->
</RelativeLayout>
作者:湖前琴亭
来源:CSDN
原文:https://blog.csdn.net/aqi00/article/details/54019399
版权声明:本文为博主原创文章,转载请附上博文链接!