2011-08-08 29 views

回答

0

当我需要设置背景的列表视图项,我一个属性添加到我发送到列表适配器是一个整数保持值1,2或3。

在适配器码的数据,在getView方法中,我检查属性值并相应地设置视图的背景颜色。有点像

if(status == 1){ 
    v.setBackgroundColor(Color.RED); 
} else if(statis == 2){ 
    v.setBackgroundColor(Color.Blue); 
} 
相关问题