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 header和Load more的问题 #24

Closed
niq2003 opened this issue May 18, 2016 · 8 comments
Closed

GridLayoutManager header和Load more的问题 #24

niq2003 opened this issue May 18, 2016 · 8 comments

Comments

@niq2003
Copy link

niq2003 commented May 18, 2016

当使用GridLayoutManager的时候,addHeaderView占的spansize应该是整个宽度,可以通过一下设置解决问题
manager.setSpanSizeLookup(new GridLayoutManager.SpanSizeLookup() {
@OverRide
public int getSpanSize(int position) {
if (position == 0) {
return 2;
}
return 1;
}
});
但是loadmore view占地spansize不是整个宽度,看了下代码,loadmore处理了StaggeredGridLayoutManager的情况,但是StaggeredGridLayoutManager的时候addHeaderView的spansize不知道如何处理

@CymChad
Copy link
Owner

CymChad commented May 18, 2016

那你直接使用StaggeredGridLayoutManager就可以了呀

@niq2003
Copy link
Author

niq2003 commented May 18, 2016

StaggeredGridLayoutManager addHeaderView header占的宽度不能通过setSpanSizeLookup设置

@CymChad
Copy link
Owner

CymChad commented May 18, 2016

哦,我知道了你就是想头部也占据一行对吧,我这边改一下就可以了

@niq2003
Copy link
Author

niq2003 commented May 18, 2016

对的,一般使用StaggeredGridLayoutManager 或GridLayoutManager 的时候headerview和footerview的需求大部分都是占一行吧

@CymChad
Copy link
Owner

CymChad commented May 18, 2016

恩 是的,我这边改一下,然后你在试试,稍等5分钟

CymChad pushed a commit that referenced this issue May 18, 2016
@CymChad
Copy link
Owner

CymChad commented May 18, 2016

compile 'com.github.CymChad:BaseRecyclerViewAdapterHelper:v1.7.1' 你试一下

@niq2003
Copy link
Author

niq2003 commented May 18, 2016

试了一下这个问题已经解决,谢谢~

@CymChad
Copy link
Owner

CymChad commented May 18, 2016

没事,有问题再提哦

@CymChad CymChad closed this as completed May 18, 2016
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

2 participants