米娅的android之旅
android开发群群号:84926730

在listview的自定义adapter里面的getView方法里面,加上以下代码:

            if (position % 2 == 0) {
                convertView.setBackgroundDrawable(getResources().getDrawable(
                        R.drawable.newtask_list_item_normal));
            } else {
                convertView.setBackgroundDrawable(getResources().getDrawable(
                        R.drawable.newtask_list_item_selected));
            }

 

posted on 2012-08-29 11:00  程序缘儿  阅读(1193)  评论(0编辑  收藏  举报