<TextView
android:id="@+id/bind_card_tv2"
style="@style/widget_weightW_w"
android:background="@null"
android:drawableLeft="@null"
android:drawablePadding="10dp"
android:textColor="@color/widget_black"
android:textSize="@dimen/text_15" />
设置drawableLeft
Drawable drawable= getResources().getDrawable(R.drawable.drawable);
/// 这一步必须要做,否则不会显示.
drawable.setBounds(0, 0, drawable.getMinimumWidth(), drawable.getMinimumHeight());
myTextview.setCompoundDrawables(drawable,null,null,null);
设置drawableRight
<pre name="code" class="java">titleTv.setCompoundDrawables(null, null, drawable, null);//画在右边