Closed peddiraju211 closed 7 years ago
@jaychang0917 Sorry for incomplete question
Can we add header view for RecyclerView at Section Header functionality ? From below screenshot I have used fixed header view. But I want to add that header view along with RecyclerView items. Any suggestions?
What's your fixed header view mean? Sticky? Can you describe what effect you want?
The RecyclerView first item must be a header view/inflate a view and when we scroll RecyclerView the header view also scroll along with RecyclerView items.
New release 1.1.2
supports multiple cell type for section header now. Pls check it out.
If you have any further questions, please feel free to reopen this issue, thanks!
Could you please explain more about how to add that "Header" using multiple cell type ?
I have tried with below code but not working well
@Override
public View getSectionHeaderView(PersionData item, int position) {
if(position==0){
View view = LayoutInflater.from(getActivity()).inflate(R.layout.header_item, null, false);
TextView textView = (TextView) view.findViewById(R.id.txtHeader);
textView.setText("Header");
return view;
}else{
View view = LayoutInflater.from(getActivity()).inflate(R.layout.view_section_header, null, false);
TextView textView = (TextView) view.findViewById(R.id.textView);
textView.setText(String.format(getString(R.string.branchInformation), item.getCategoryName()));
return view;
}
}
You can refer to multi_types.
Your getSectionHeaderView()
method should return your section view only, and create a new header cell, then call recyclerview.addCell(0, headerCell)
.
Hi @peddiraju211 what do you means?