I want to create a listview with separators like in the default contacts application. My application needs that the list be sorted and the items be separated by separators(like the alphabetical sorting in contacts application). Being able to scroll using the separator titles would be an added advantage. Any pointers would be helpful. Thanks!!
To remove the separator using XML property you must simply add android:divider="@null" property to the ListView View that you have defined in the layout file.
By default ListView separator line color is like light black but app developer can modify the listview separator line color using android:divider=” “ attribute in listview widget inside activity_main. xml layout file.
Take a look at this open source project, it gives you headers and they are sticky too:
https://github.com/emilsjolander/StickyListHeaders
Go to your android-sdk\samples folder. There's a lot of examples with source. Try api demos -> Views -> Lists. This samples are everything you need and even more. Moreover HERE are official examples in Lists
section.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With