recycleview和scrollive的配合使用,在6.0以下正常使用。在6.0上高度显示不全的问题
2016-11-15 08:56
375 查看
直接在recycleview加一层相对布局就可以了
<RelativeLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:descendantFocusability="blocksDescendants"> <android.support.v7.widget.RecyclerView android:id="@+id/menuRv" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginLeft="@dimen/margin_16" android:layout_marginRight="@dimen/margin_16"> </android.support.v7.widget.RecyclerView> </RelativeLayout>
关键代码是android:descendantFocusability="blocksDescendants" 该属性是当一个为view获取焦点时,定义viewGroup和其子控件两者之间的关系。 属性的值有三种: beforeDescendants:viewgroup会优先其子类控件而获取到焦点 afterDescendants:viewgroup只有当其子类控件不需要获取焦点时才获取焦点 blocksDescendants:viewgroup会覆盖子类控件而直接获得焦点
相关文章推荐
- Android 6.0 解决recyclerview 在 scrollview 中不能全部显示,高度不正常的问题
- Android 6.0以上 解决recyclerview 在 scrollview 中不能全部显示,高度不正常的问题
- Android 6.0 解决recyclerview 在 scrollview 中不能全部显示,高度不正常的问题。
- Android 6.0 scrollview 嵌套recyclerview不能全部显示,高度不正常的问题
- Android 6.0 解决recyclerview 在 scrollview 中不能全部显示,高度不正常的问题
- Android 6.0 解决recyclerview 在 scrollview 中不能全部显示,高度不正常的问题
- Android 6.0 解决recyclerview 在 scrollview 中不能全部显示,高度不正常的问题
- 关于6.0ScrollView嵌套RecyclerView高度不正确显示不全问题解决办法
- Android 6.0 解决recyclerview 在 scrollview 中不能全部显示,高度不正常的问题。
- Android 6.0 scrollview 嵌套recyclerview不能全部显示,高度不正常的问题
- Android 6.0 解决recyclerview 在 scrollview 中不能全部显示,高度不正常的问题
- Android 6.0 解决recyclerview 在 scrollview 中不能全部显示,高度不正常的问题
- Android 6.0 解决recyclerview 在 scrollview 中不能全部显示,高度不正常的问题。
- 解决Scrollview 嵌套recyclerview不能显示,高度不正常的问题
- 渐变toolbar,悬浮控件,scrollview和recycleview滑动冲突及显示不全问题解决
- 使用Xlistview时TextView自动换行或ScrollView嵌套Listview高度显示不全
- 解决Scrollview 嵌套recyclerview不能显示,高度不正常的问题
- android RecycleView 嵌套问题切换页面跳动问题、嵌套展开显示不全问题处理方法
- [Android]浮层视频效果,在另外一个Window使用SurfaceView无法正常显示的问题排查与解决
- 解决Scrollview 嵌套recyclerview不能显示,高度不正常的问题