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?
ListView separators using a CursorAdapter
Asked Answered
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,
Thanks for your reply. I'll have a look –
Harrie
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 again –
Harrie
The link is for a private blog which cannot be viewed. :( –
Adey
Update to new samples because of problems with the original one. Tks –
Giusto
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.
Should have posted your previous answer's link here rather than pasting it completely –
Kathykathye
© 2022 - 2024 — McMap. All rights reserved.