0

In my listview, I am trying to decide which is better. To have a fixed header or to just create a custom row that is part of the normal list that scrolls. As a fixed header, it stays at the top of the list while the items within the list scroll. The downside is that it takes up space. My alternative is just to create a custom quasi header that is created like all the other rows (only laid out differently). I'm not sure what is involved, whether this is possible and whether I will end up having issues to deal with. Has anyone done a custom header inside the adapter?

Johann
  • 27,536
  • 39
  • 165
  • 279

1 Answers1

0

Personally, I would go with a static header... A header is no use (IMO) if it's not visible.

However, if you want to include it in your list that is possible. There are several different methods, but the one I would recommend is using MergeAdapter by CommonsWare.

I talked about it recently in another answer here.

Community
  • 1
  • 1
Barak
  • 16,318
  • 9
  • 52
  • 84
  • You're assuming the header acts like a header in a spreadsheet that aligns with columns. This isn't the case. the header would contain a summary of things that have no relationship with the data in the list. So even though it's not fixed, it is still useful. – Johann May 25 '12 at 14:57
  • True, but you didn't specify that. :p Anyway, if you want to put them in the MergeAdapter is pretty much the easiest way I've ever seen to accomplish that. – Barak May 25 '12 at 15:01