cymcsg / UltimateRecyclerView

A RecyclerView(advanced and flexible version of ListView in Android) with refreshing,loading more,animation and many other features.
Apache License 2.0
7.22k stars 1.43k forks source link

How can i set a header when i use the expandURV #449

Open Jarvay opened 7 years ago

Jarvay commented 7 years ago

i tried to use method setNormalHeader,but it didn't work

sprhawk commented 7 years ago

@Jarvay try to setNormalHeader before setAdapter

Jarvay commented 7 years ago

@sprhawk thanks for your answer,i found out the reason. The LinearExpanxURVAdapter overrided method getItemViewType. @Override public int getItemViewType(int position) { return mDataSet.get(position).getType(); }

lhholylight commented 7 years ago

@sprhawk I setNormalHeader before setAdapter but in also not show

hudan2714 commented 6 years ago

i have same problem,but i used adapter.setheaderview. no used recycleview.setheadview.you can use adapter setheader ,but notice the getAdapterItemCount need +1.