天天看點

ListView間隔設定顔色

在Adapter的getView中

if (position % 2 == 0)

holder.shoucangbt.setBackgroundColor(

Color.rgb(246, 246, 246));

else

convertView.findViewById(R.id.shoucangbt).setBackgroundColor(

Color.rgb(235, 235, 235)

);