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

XRecyclerView中的setGridSpanLookUp(GridLayoutManager layoutManager, final GridLayoutManager.SpanSizeLookup lookup)方法存在问题。 #15

Open
wosika opened this issue Mar 1, 2018 · 0 comments

Comments

@wosika
Copy link

wosika commented Mar 1, 2018

您好,非常感谢作者的开源这个控件我个人觉得非常好用,但是今天使用的时候发现一个问题,特来请求修复。

在XRecyclerView的代码344行中。

public void setGridSpanLookUp(GridLayoutManager layoutManager, final GridLayoutManager.SpanSizeLookup lookup) {
layoutManager.setSpanSizeLookup(new GridLayoutManager.SpanSizeLookup() {
@OverRide
public int getSpanSize(int position) {
if (adapter != null) {
if (adapter.isHeaderOrFooter(position)) return 1; //注意这里

                return lookup.getSpanSize(position);
            }
            return GridLayoutManager.DEFAULT_SPAN_COUNT;
        }
    });
}

//中的

 if (adapter.isHeaderOrFooter(position)) return 1;//不应该返回1 

而是返回layoutManager.getSpanCount() ,返回1 导致GridLayout布局下底部占用为1个item无法占满。
应该是作者大大粗心了,因为第321行中的方法就没有写错。

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

1 participant