activity中直接
Drawable drawable = getResources().getDrawable(R.mipmap.ic_pay_koukuan);
drawable.setBounds(0, 0, drawable.getMinimumWidth(), drawable.getMinimumHeight());
tv_text.setCompoundDrawables(drawable, null, null, null);
在adapter中
在引用的地方传值一个context
Drawable drawable = context.getResources().getDrawable(R.mipmap.ic_pay_koukuan);
drawable.setBounds(0, 0, drawable.getMinimumWidth(), drawable.getMinimumHeight());
viewHolder.tv_text.setCompoundDrawables(drawable, null, null, null);