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

headview 需要自己设置layoutparams才能填充父布局 #17

Open
simplepeng opened this issue May 9, 2016 · 1 comment
Open

headview 需要自己设置layoutparams才能填充父布局 #17

simplepeng opened this issue May 9, 2016 · 1 comment

Comments

@simplepeng
Copy link

like this :
public void addHeaderView(View header) {

    if (header == null) {
        throw new RuntimeException("header is null");
    }
    header.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT
            ,ViewGroup.LayoutParams.WRAP_CONTENT));
    mHeaderViews.add(header);
    this.notifyDataSetChanged();
@Ezioer
Copy link

Ezioer commented Sep 23, 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