Android 动态改变图片的颜色值-LMLPHP

public void onViewClicked(View view) {
switch (view.getId()) {
case R.id.bt1:
img1.setColorFilter(getResources().getColor(R.color.color3));
break;
case R.id.bt2:
img1.setColorFilter(getResources().getColor(R.color.color1));
break;
case R.id.bt3:
img1.setColorFilter(getResources().getColor(R.color.color2));
break;
} }
05-11 20:13