-1
如何將背景顏色添加到整行,而不僅僅是在R.id.data列上?viewbinder row backgroundcolor
adapter.setViewBinder(new SimpleCursorAdapter.ViewBinder() {
public boolean setViewValue(View view, Cursor cursor, int columnIndex) {
if (view.getId() == R.id.data)
{
if(cursor.getPosition() % 2 == 0)
{
view.setBackgroundColor(Color.LTGRAY);
}
else {
view.setBackgroundColor(Color.CYAN);
}
return false;
}
return false;}
});
獲取父視圖並設置其背景 – pskink