解决scrollview嵌套recycle人view显示不全的问题
最近在开发的项目的时候遇到这样的需求效果图是这样的
使用的布局是 scrollview嵌套recycle人view ,说实话这样的开发需求很的常见吧,高高兴兴开发完成,但是测试的时候发现,完蛋了,完美采坑,recycle人view的条目遇到现实不全的bug ,查阅资料,最后杀出了一条血路 ,在这里记录一下
1.显示不全怎样解决
很简单只需要在recyclerview的外层单独套一层viewgroup就像我这样
<ScrollView
android:id="@+id/sc"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true">
....
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="300px"
android:descendantFocusability="blocksDescendants"
>
<android.support.v7.widget.RecyclerView
android:id="@+id/rv_repair"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="30px"
android:background="#fff" />
</RelativeLayout>
</ScrollView>
好了问题到这里已经完美的解决了尽情的享受好了