关于6.0ScrollView嵌套RecyclerView高度不正确显示不全问题解决办法
来源:互联网 发布:网络犯罪的危害 编辑:程序博客网 时间:2024/06/05 08:49
针对ScrollView和RecyclerView的嵌套问题,网上有很多解决办法.
但是我只用一个办法成功解决.下面记录下来
<ScrollView android:layout_width="match_parent" android:layout_height="match_parent"> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="测试文字1" /> <RelativeLayout android:layout_width="match_parent" android:layout_height="wrap_content" > <android.support.v7.widget.RecyclerView android:layout_width="match_parent" android:layout_height="wrap_content" /> </RelativeLayout> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="测试文字2" /> <RelativeLayout android:layout_width="match_parent" android:layout_height="wrap_content" > <android.support.v7.widget.RecyclerView android:layout_width="match_parent" android:layout_height="wrap_content" /> </RelativeLayout> </LinearLayout></ScrollView>
主要问题出在布局上,6.0需要我们在RecyclerView外层在套一层RelativeLayout.即可完美解决ScrollView嵌套RecyclerView高度问题.
另:推荐在代码中加入
RecyclerView.setNestedScrollingEnabled(false);
可消除滑动时粘滞感!完毕!
阅读全文
0 0
- 关于6.0ScrollView嵌套RecyclerView高度不正确显示不全问题解决办法
- 关于Scrollview嵌套RecyclerView高度显示不全
- Scrollview嵌套RecyclerView高度显示不全
- ScrollView 嵌套 RecyclerView 高度自适应,item显示不全 问题
- ScrollView嵌套RecyclerView显示不全
- ScrollView和RecyclerView嵌套使用显示不全问题解决
- ScrollView中嵌套ListView时显示不全的问题解决办法
- ListView(ScrollView)嵌套ListView、GridView显示不全,内容大于一行计算的高度不正确的解决办法
- Android 6.0+ RecyclerView嵌套在ScrollView中显示不全
- ScrollView嵌套Listview/RecyclerView内容显示不全
- scrollView嵌套recyclerView (再嵌套recyclerView )显示不全
- Scrollview嵌套Recyclerview出现的问题解决办法
- ScrollView嵌套RecyclerView 导致RecyclerView数据显示不全
- scrollView嵌套recyclerView 显示不全(已解决)
- 解决ScrollView嵌套RecyclerView时item显示不全的问题
- Fragment里ScrollView嵌套RecyclerView显示不全的问题
- 解决android6.0ScrollView嵌套RecyclerView显示不全问题
- 解决ScrollView嵌套RecyclerView出现item显示不全的问题
- 迪菲-赫尔曼秘钥交换(Diffie-Hellman Key Exchange)
- codeforces 731A Night at the Museum
- #struts2零配置中的常量配置
- 贪心算法例题:2072删数问题
- python爬虫入门 实战(四)---爬“榜姐”话题微博及热门评论
- 关于6.0ScrollView嵌套RecyclerView高度不正确显示不全问题解决办法
- Python学习笔记-tips: 什么是*args和**kwargs?
- 数据库---事务的特性
- ???2080最长公共子序列问题
- 同样是App渠道统计,为什么差别那么大
- android之seekBar
- 蛇形填数*
- 数据标准化/归一化normalization
- javaweb项目搭建ehcache缓存系统