代码方式为TextView控件设置drawableLeft图标,并设置间距
//在左侧添加图片Drawable drawable= getResources().getDrawable(R.drawable.gray_circle);
drawable.setBounds(0, 0, drawable.getMinimumWidth(), drawable.getMinimumHeight());
textView.setCompoundDrawables(drawable, null, null, null);
textView.setCompoundDrawablePadding(4);//设置图片和text之间的间距
页:
[1]