Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gridLayoutManager.setSpanSizeLookup会发生错乱? #13

Closed
open9527 opened this issue Mar 23, 2020 · 6 comments
Closed

gridLayoutManager.setSpanSizeLookup会发生错乱? #13

open9527 opened this issue Mar 23, 2020 · 6 comments

Comments

@open9527
Copy link

gridLayoutManager.setSpanSizeLookup(new GridLayoutManager.SpanSizeLookup() {
@OverRide
public int getSpanSize(int position) {
//TODO:需要区分单张/多张 所占的位置,
if (position == 0) {
return 6;
}
if (position > 2 && position < 5) {
return 3;
}
return 2;
}
});

配置这个操作之后分割线显示错乱

@youlookwhat
Copy link
Owner

这个确实没处理,我抽时间处理一下~

@youlookwhat
Copy link
Owner

已处理好,更新最新的包就好了~
implementation 'com.github.youlookwhat:ByRecyclerView:1.0.18' // AndroidX版本引入

@imtianx
Copy link

imtianx commented Apr 15, 2020

有没有遇到最后一行的最后一个显示的有问题
9B194BAE-2B49-4EAD-9C1C-732AE8827393

@youlookwhat
Copy link
Owner

默认是不显示最后一行的分割线,因为一般会使用到加载更多。
如果你没使用加载更多,请将最后一行的的分割线去掉:

/**
 * 设置从哪个位置 结束设置间距
 *
 * @param startFromSize 一般为HeaderView的个数 + 刷新布局(不一定设置)
 * @param endFromSize   默认为1,一般为FooterView的个数 + 加载更多布局(不一定设置)
 */
public GridSpaceItemDecoration setNoShowSpace(int startFromSize, int endFromSize)

// endFromSize: 这个参数设置为 0

@imtianx
Copy link

imtianx commented Apr 15, 2020

默认是不显示最后一行的分割线,因为一般会使用到加载更多。
如果你没使用加载更多,请将最后一行的的分割线去掉:

/**
 * 设置从哪个位置 结束设置间距
 *
 * @param startFromSize 一般为HeaderView的个数 + 刷新布局(不一定设置)
 * @param endFromSize   默认为1,一般为FooterView的个数 + 加载更多布局(不一定设置)
 */
public GridSpaceItemDecoration setNoShowSpace(int startFromSize, int endFromSize)

// endFromSize: 这个参数设置为 0

多谢,看了下代码已经解决了😂

@youlookwhat
Copy link
Owner

解决了就好😘

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants