Android Killer
Android Killer

Reputation: 18489

How to add a circle to ListView

I have a listview.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?

Upvotes: 0

Views: 1065

Answers (2)

Michael
Michael

Reputation: 54705

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.

Upvotes: 1

u.jegan
u.jegan

Reputation: 833

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

Upvotes: 1

Related Questions