开发者

Listview item color

开发者 https://www.devze.com 2022-12-22 09:20 出处:网络
My list view is a multiple selection list view. i have to show the selected list view items in one color(say green) and the other ite开发者_C百科ms in some other color(red). How to achieve this?It dep

My list view is a multiple selection list view. i have to show the selected list view items in one color(say green) and the other ite开发者_C百科ms in some other color(red). How to achieve this?


It depends what you mean by showing "items in [...] color." The easiest way to change items' colors is to do it in the Adapter's getView() or bindView() method.


In the onItemSelectListner change the item background to whichever you need.


You could call the setBackgroundColor() method in the select event to change the background color.

0

精彩评论

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

关注公众号