StickyListHeaders icon indicating copy to clipboard operation
StickyListHeaders copied to clipboard

Any way to hide the first header?

Open codyrotwein opened this issue 10 years ago • 4 comments

Unable to send null to getHeaderView. I don't want to display a blank header above the first row.

codyrotwein avatar Jan 27 '15 15:01 codyrotwein

you can use the common ListView instead of this Custome ListView. Of course, you can modify the source code. in the class AdapterWrapper's configureHeader method if(header == null) throw new NullPointerException("Header view must not be null."); alter to if(header == null) return null; then you can return null to getHeaderView. but this modification is change the goal of the custom ListView

tomcatter avatar Jan 28 '15 02:01 tomcatter

you can set the view visibility to 'gone', for the first header

jaydp17 avatar Apr 11 '15 14:04 jaydp17

Do you solve this problem?i dont need the first too,i chang my code like above but not useful, in adapter method getViewHeader(),if(position == 0){convertView.setVisibility(View.GONE);} not useful.

FeverCombo3 avatar Nov 02 '15 03:11 FeverCombo3

I got around the issue by basically creating a list row layout that's 0dp in height. And then just conditionally show it if it's the first row: if(position == 0) { convertView = mInflater.inflate(R.layout.list_row_header_blank, parent, false); } else { convertView = mInflater.inflate(R.layout.list_row_alerts_header, parent, false); }

codyrotwein avatar Nov 02 '15 14:11 codyrotwein