listview 第一行 第三行 第五行... 背景颜色是 #242625
,偶数行 第二第四 第六...行背景颜色 是 #0d1215,怎么实现,给出实现代码!感激不尽!!!listView01=(ListView)findViewById(R.id.listview_cityselect_01); class ListBgColor extends BaseAdapter{ public int getCount() {
return 0;
} public Object getItem(int position) {
return position;
} public long getItemId(int position) {
return 0;
} public View getView(int position, View convertView, ViewGroup parent) {
// TODO Auto-generated method stub
if (position%2==0) {
listView01.setBackgroundColor(???);
}
else {
listView01.setBackgroundColor(???);
}
return ???;
}
,偶数行 第二第四 第六...行背景颜色 是 #0d1215,怎么实现,给出实现代码!感激不尽!!!listView01=(ListView)findViewById(R.id.listview_cityselect_01); class ListBgColor extends BaseAdapter{ public int getCount() {
return 0;
} public Object getItem(int position) {
return position;
} public long getItemId(int position) {
return 0;
} public View getView(int position, View convertView, ViewGroup parent) {
// TODO Auto-generated method stub
if (position%2==0) {
listView01.setBackgroundColor(???);
}
else {
listView01.setBackgroundColor(???);
}
return ???;
}
convertView.setBackgroundColor(0xFF242625);
}else{
convertView.setBackgroundColor(0xFF0d1215);
}
http://hi.csdn.net/space-7187639-do-album-picid-1063027.html