开发者

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜