youlookwhat / ByRecyclerView

🔥 RecyclerView 下拉刷新、上拉松手/自动加载更多、item点击/长按、item局部刷新、头布局/尾布局/状态布局、万能分割线、Skeleton骨架图、极简adapter、嵌套滑动置顶
https://youlookwhat.github.io/ByRecyclerView
Apache License 2.0
798 stars 139 forks source link

GridItemDecoration使用问题 #29

Closed zhaoxuan365 closed 3 years ago

zhaoxuan365 commented 3 years ago

当GridLayoutManager设置为Horizontal时,GridItemDecoration第一个和第二个条目的宽高绘制出错。有关代码和布局见附件。

includeEdge = false includeEdge = true GridLayout 水平方向 activity布局 条目布局

youlookwhat commented 3 years ago

GridItemDecoration里为了友好支持加载更多,默认设置了最后一个item没有分割线,你试试 setEndFromSize(0),看是否解决。

zhaoxuan365 commented 3 years ago

GridItemDecoration里为了友好支持加载更多,默认设置了最后一个item没有分割线,你试试 setEndFromSize(0),看是否解决。

可能是我之前的表述不清楚,让你误解了。我重新描述一下:当RecyclerView使用GridLayoutManager,且GridLayoutManager的方向设置为Horizontal时,使用GridItemDecoration设置分割线,列表中的第一个和第二个条目的高度和后面的不一样,并且没有对齐。PS:setEndFromSize(0)不能解决这个问题。 微信截图_20210511102017

youlookwhat commented 3 years ago

好 我看看

youlookwhat commented 3 years ago

是的,我没处理GridLayoutManager横向的情况,线性的横向处理了,我抽时间完善一下。紧急的话你先自己在布局里按位置处理一下哈

zhaoxuan365 commented 3 years ago

好的。不着急,我先自己试着解决一下,等你完善后再对比一下

youlookwhat commented 3 years ago

恩恩 好

youlookwhat commented 3 years ago

已完成一半,好稍等

zhaoxuan365 commented 3 years ago

嗯嗯,不着急

youlookwhat commented 3 years ago

已经解决,简单点说是在设置纵向的 上下左右间距的地方,横向的改成 左右上下。你那边是这样吗

zhaoxuan365 commented 3 years ago

非常感谢,作者辛苦。--|| 我还没来得及自己试着解决 --||

youlookwhat commented 3 years ago

直接依赖 1.1.6 就好😁

zhaoxuan365 commented 3 years ago

嗯嗯

youlookwhat commented 3 years ago

下关了哈,有问题再开。