关于ScrollView嵌套RecyclerView时RecyclerView不显示的问题
来源:互联网 发布:禹卫书法行书简体 mac 编辑:程序博客网 时间:2024/05/16 07:30
在新版本中需求变更导致布局需要变化,RecyclerView外需要一层ScrollView来处理滑动。发布前夕发现在API 23 & 24上RecyclerView显示不完整。
光速冷静下来,马上去stackoverflow翻了一下,有人说ScrollView加上
android:fillViewport="true"
,但是我加上并没有解决问题。后来在RecyclerView外面加了一层RelativeLayout,问题解决。如果你在API 23 & 24上也遇到这个问题,可以参考一下。<android.support.v4.widget.NestedScrollView android:layout_width="match_parent" android:layout_height="match_parent" > <!-- DEV NOTE: Outer wrapper relative layout is added intentionally to address issue that only happens on Marshmallow & Nougat devices (API 23 & 24). On marshmallow API 23, the "RecyclerView" `layout_height="wrap_content"` does NOT occupy the height of all the elements added to it via adapter. The result is cut out items that is outside of device viewport when it loads initially. Wrapping "RecyclerView" with "RelativeLayout" fixes the issue on Marshmallow devices. --> <RelativeLayout android:layout_width="match_parent" android:layout_height="wrap_content"> <com.jcodecraeer.xrecyclerview.XRecyclerView android:id="@+id/rv_fragment_find_tips_list" android:layout_width="match_parent" android:layout_height="wrap_content" /> </RelativeLayout> </android.support.v4.widget.NestedScrollView>
然后在代码里添加如下:
阅读全文
0 0
- 关于ScrollView嵌套RecyclerView时RecyclerView不显示的问题
- ScrollView嵌套RecyclerView,RecyclerView不显示问题
- RecyclerView 与 scrollview嵌套不显示问题
- 解决ScrollView嵌套RecyclerView,RecyclerView不显示问题
- 关于ScrollView嵌套RecyclerView遇到的问题
- 解决ScrollView嵌套RecyclerView时item显示不全的问题
- 解决ScrollView里嵌套 RecyclerVIew 时,RecyclerVIew 滑动不流畅的问题
- 解决ScrollView里嵌套多个RecyclerView时,RecyclerView数据显示不全的问题
- Scrollview嵌套Recyclerview出现的显示不全 不显示问题的解决方法
- 关于Scrollview嵌套RecyclerView高度显示不全
- Scrollview 嵌套 RecyclerView 出现的问题,例如recycleview不显示,或者卡动。
- 解决ScrollView嵌套RecyclerView导致滑动不流畅的问题
- 解决ScrollView嵌套RecyclerView导致滑动不流畅的问题
- 解决ScrollView嵌套RecyclerView导致滑动不流畅的问题
- 解决ScrollView嵌套RecyclerView导致滑动不流畅的问题
- ScrollView嵌套recyclerView问题
- scrollview嵌套recyclerview 问题
- ScrollView嵌套RecyclerView 问题
- c# 中调用EnumChildWindow
- 二级联动
- 【css】常用知识点小结
- 大数据初学者应该知道的知识
- spring Junit单元测试事务管理报错:java.lang.IllegalStateException: Failed to load ApplicationContext解决办法
- 关于ScrollView嵌套RecyclerView时RecyclerView不显示的问题
- CentOS-7.0./linux中安装与配置Tomcat-7的方法
- hdu4046(树状数组)
- 存款问题
- 整理学习的框架(2)--mybatis+spring
- DateTimeHelper扩展类
- 感兴趣的很多,擅长的却没一个
- 如何用R连接mysql数据库
- oracle 系统表查询表是否死锁语句