cundong / HeaderAndFooterRecyclerView

A RecyclerView solution, support addHeaderView、addFooterView
Apache License 2.0
1.37k stars 321 forks source link

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

Open simplepeng opened 8 years ago

simplepeng commented 8 years ago

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 commented 7 years ago

关于这个困扰了我一下午 多谢大神的解答