HeaderAndFooterRecyclerView
HeaderAndFooterRecyclerView copied to clipboard
headview 需要自己设置layoutparams才能填充父布局
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();
关于这个困扰了我一下午 多谢大神的解答