ListView separators using a CursorAdapter
Asked Answered
H

2

8

I have a ListView which is populated using a CursorAdapter. I'd also like to have some separators in my ListView. I have accomplished this with an ArrayAdapter, but I'm not sure how to accomplish this with a CursorAdapter. Are there any strategies for doing so? Or am I out of luck?

Harrie answered 5/10, 2010 at 15:30 Comment(0)
G
5

Here's some examples: http://bartinger.at/listview-with-sectionsseparators/

http://sunil-android.blogspot.com/2013/08/section-header-listview-in-android.html

Projects: http://code.google.com/p/android-section-list/

http://code.google.com/p/android-amazing-listview/

Best,

Giusto answered 5/10, 2010 at 16:12 Comment(4)
Thanks for your reply. I'll have a lookHarrie
Ah, I see what you're doing. The layout for every list item contains a LinearLayout which acts as a separator, but some contraint determines whether you hide or show the LinearLayout. I don't think the constraint is particularly important other than it works, but the separator is ultimately present in every item. Neat idea. I think I will try it out. Thanks againHarrie
The link is for a private blog which cannot be viewed. :(Adey
Update to new samples because of problems with the original one. TksGiusto
B
1

Also this one: http://code.google.com/p/android-section-list/, here section header is "sticky" at the top of the list which makes it really nice.

Blakley answered 13/6, 2011 at 0:29 Comment(1)
Should have posted your previous answer's link here rather than pasting it completelyKathykathye

© 2022 - 2024 — McMap. All rights reserved.