xiangcman / LayoutManager-FlowLayout

快速利用RecyclerView的LayoutManager搭建流式布局
674 stars 157 forks source link

wrap_content又失效了..... #6

Open ynpl opened 7 years ago

ynpl commented 7 years ago

wrap_content又失效了.....

ynpl commented 7 years ago

RecyclerView 要是wrap_content 里面的数据就不显示了 , 下午用的时候还好的 然后晚上回家心思弄下代码 然后从新倒了你的库 就不好用了 然后我看你的 an hour ago更新的 是不是更新的时候弄错哪了啊

xiangcman commented 7 years ago

这里你可以在onmeasure方法里面获取下两个高度。一个是content的。另一个是本身内容的高度。 我这边测试是没问题的

ynpl commented 7 years ago

好我明天试试 去公司看看吧

YongshengLuan commented 7 years ago

RecyclerView 要是wrap_content 时,第一次打开app时 里面数据不显示 ,,但是点击一下输入框时 ,就显示出来了,,但是RecyclerView 的高度如果写成一个固定值的话 就不会出现这个问题,,,求助

xiangcman commented 7 years ago

这里在测量的方法里面看下activity的content的高度 因为你这里如果是wrap_content的话。高度是按照content来测量的高度

发自我的 iPhone

在 2017年8月1日,19:06,Johnny notifications@github.com 写道:

RecyclerView 要是wrap_content 时,第一次打开app时 里面数据不显示 ,,但是点击一下输入框时 ,就显示出来了,,但是RecyclerView 的高度如果写成一个固定值的话 就不会出现这个问题,,,求助

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

YongshengLuan commented 7 years ago

是这样 我刚才 在其他手机上试了一下 是没问题的,,但是 在nexus6 上时 就会出现那个问题呢,,还有 你说的“在测量的方法里面看下activity的content的高度” 这里是怎么修改呢

chengchauanchen commented 6 years ago

我的也是这样显示不出来,然后我重写了recyclerview,在onMeasure方法里面设置模式为MeasureSpec.AT_MOST就好了,不知道其他的手机会不会有这个问题,我的是华为荣耀8