转载请注明链接:https://blog.youkuaiyun.com/feather_wch/article/details/88293585
试过很多办法,但是都是标题党。本问题绝对可以解决。
RecyclerView 高度 wrap_content 失效的问题
版本:2019-03-07(12:30)
RecyclerView的属性
android:layout_height="wrap_content"
出现了失效的问题,我是用的GridLayoutManager,结果只有一行的数据。
该问题是谷歌的BUG
修复方法
1、修复方法
- 用
RelativeLayout
包裹RecyclerView
,RelativeLayout的高度采用wrap_content
RecyclerView
的高度,采用match_parent
如下:
<RelativeLayout