更新时间:2023-12-05 16:28:34
试试这个 ..
txtview.setCompoundDrawablesWithIntrinsicBounds(
R.drawable.image, 0, 0, 0);
也看到这个.. http://developer.android.com/reference/android/widget/TextView.html
在xml文件中试试这个
Try this in xml file
<TextView
android:id="@+id/txtStatus"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:drawableLeft="@drawable/image"
android:drawablePadding="5dp"
android:maxLines="1"
android:text="@string/name"/>