待整理

1
2
//设置drawableTOP图片和文字之间的padding
tv.setCompoundDrawablePadding(DisplayUtil.dip2px(10,mContext.getResources().getDisplayMetrics().density));

xml中使用

1
2
Related XML Attributes
android:drawablePadding

代码中设置drawableLeft/Top/Bottom/Right

1
2
3
Drawable drawableLeft = mContext.getResources().getDrawable(R.drawable.goods_prompt);
drawableLeft.setBounds(0, 0, drawableLeft.getIntrinsicWidth(), drawableLeft.getIntrinsicHeight());
viewHolder.good_profits.setCompoundDrawables(drawableLeft,null,null,null);