在项目中遇到这种情况, 在6.0手机上发现 ScrollView嵌套RecyclerView显示不完全,而在6.0以下手机上显示却是正常的,这就很奇怪,上网搜索一番,结果发现只需要在RecyclerView外层在嵌套个RelativeLayout就行了,
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:descendantFocusability="blocksDescendants">
<android.support.v7.widget.RecyclerView
android:id="@+id/recyvleView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:overScrollMode="never"
android:background="#fafafa">
</android.support.v7.widget.RecyclerView>
</RelativeLayout>
另外发现ScrollView嵌套RecyclerView在滑动时不流畅,存在冲突,解决办法在代码中设置setNestedScrollingEnabled(false)即可,
recyvleView.setNestedScrollingEnabled(false);