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

setHeaderView 不支持 GridLayoutManager 吗? #5

Closed
Null-Ouwenjie opened this issue Dec 5, 2015 · 2 comments
Closed

setHeaderView 不支持 GridLayoutManager 吗? #5

Null-Ouwenjie opened this issue Dec 5, 2015 · 2 comments

Comments

@Null-Ouwenjie
Copy link

        layoutManager = new GridLayoutManager(getContext(), 3);
        cateCommodityList.setLayoutManager(layoutManager);

        adapter = new CategoryAdapter(getContext(), categories);
//        cateCommodityList.setAdapter(adapter);

        mHeaderAndFooterRecyclerViewAdapter = new HeaderAndFooterRecyclerViewAdapter(adapter);
        cateCommodityList.setAdapter(mHeaderAndFooterRecyclerViewAdapter);

        View headerView = LayoutInflater.from(getContext()).inflate(R.layout.layout_cate_header, null);
        //add a HeaderView
        RecyclerViewUtils.setHeaderView(cateCommodityList, headerView);

结果 header 并不能出现在顶部,而是一个普通的item..

@Null-Ouwenjie Null-Ouwenjie changed the title addHeader 不支持 GridLayoutManager吗? setHeaderView 不支持 GridLayoutManager吗? Dec 5, 2015
@Null-Ouwenjie Null-Ouwenjie changed the title setHeaderView 不支持 GridLayoutManager吗? setHeaderView 不支持 GridLayoutManager 吗? Dec 5, 2015
@cundong cundong closed this as completed Dec 7, 2015
@Null-Ouwenjie
Copy link
Author

get it !
thank you

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