android - Background Color Recycled in ListView -
i have strange problem. setting background color of items of listview so:
@override public view getview(int position, view convertview, viewgroup parent) { view row = convertview; ... if (status == true) { row.setbackgroundcolor(color.argb(255,0,85,187)); } else { if (morestuff) { row.setbackgroundcolor(color.argb(128,255,0,0)); } } ... } this seems work. however, when scroll on listview, , back, of rows have acquired color row without being set code. suspect listview recycling views optimization.
how can fix this?
the getview called time when listview drawn. taking called when small change example small scroll
if want set color specific row, checking position (first argument of getview).
Comments
Post a Comment