Drawable rightDrawable = getResources().getDrawable(R.drawable.icon_new);

//调用setCompoundDrawables时,必须调用Drawable.setBounds()方法,否则图片不显示

rightDrawable.setBounds(0, 0, rightDrawable.getMinimumWidth(), rightDrawable.getMinimumHeight());  // left, top, right, bottom
tvVersionStatus.setCompoundDrawables(null, null, rightDrawable, null);  // left, top, right, bottom

https://blog.csdn.net/catoop/article/details/39959175

<TextView android:id="@+id/tv_versionstatus"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:drawablePadding="5dp"
    android:drawableRight="@drawable/icon_new"
    android:text="版本"
    android:textColor="#363636"
    android:textSize="20sp" />

相关文章:

  • 2022-12-23
  • 2021-06-09
  • 2022-12-23
  • 2021-09-04
  • 2022-12-23
  • 2022-12-23
  • 2021-06-20
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-01-14
  • 2022-12-23
  • 2021-06-18
相关资源
相似解决方案