ckrgithub / FlexItemDecoration

FlexItemDecoration, can customize the head, bottom, leftmost, rightmost dividing line, but also customize any one of the dividing lines and batch custom multiple dividing lines

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

grid的方案有局限性

LatoAndroid opened this issue · comments

commented

下载代码试运行了一下,就垂直方向而言,提供的两种style,第一种会导致左右与中间的距离不一致,并且会比设置的分割线宽度大一倍。第二种最左边和上面的分割线无法显示。两种方案都没法定制左右分割线,第二种方案无法定制上方分割线。

commented

好像有点明白你的意思!
1.定制左右的分割线只能在水平方向有效(readme有注明),头部底部分割线的定制只能在垂直方向有效.
2.一个item=一个itemView+左上右下的decoration
3.中间的分割线比左右大,是因为每个itemView左上右下都绘制decoration造成的。
4.第二种方式的item只绘制右边和底部,仔细留意会发现最顶部和最左边的分割线是绘制在item外的(注:顶部和左边并没有占用item的区域)
所以,根据这两种style+RecyclerView的padding或者背景色,应该可以调整你想要的UI