Android:在setCompoundDrawables中,进
2017-07-04 本文已影响0人
不知鸟
Calculate image size when using setCompoundDrawables for EditText
Drawable dr = this.getResources().getDrawable(R.drawable.warning);//获得图片资源路径
Bitmap bitmap = ((BitmapDrawable) dr).getBitmap();//
Drawable d = new BitmapDrawable(this.getResources(), Bitmap.createScaledBitmap(bitmap, 35, 35, true));
txtValue.setCompoundDrawablesWithIntrinsicBounds(d, null, null, null);