How to add a circle to ListView
I have a li开发者_StackOverflowstview.I want to put texts and a circle filled with specific color in listview items.Text are different but circle should have one color only.Anyone having idea how to do it?
You need to create a custom ListAdapter, override its getView()
method and return any view you want. Usually BaseAdatper
or ArrayAdapter
classes are used as the base class. Then you need to attach this adapter to the ListView
using ListView.setAdapter()
and that's all.
you can use a shapedrawable for the view of circle and create your own custom adapter (for example see link http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/view/List4.html
精彩评论