Drawable rightDrawable = getResources().getDrawable(R.drawable.icon_new);
rightDrawable.setBounds(0, 0, rightDrawable.getMinimumWidth(), rightDrawable.getMinimumHeight());
textview.setCompoundDrawables(null, null, rightDrawable, null);
或者
holder.tvAmount.setCompoundDrawablesWithIntrinsicBounds(0, 0, R.drawable.ic_recharge_diamonds, 0);
本文详细介绍了如何在Android应用中动态地为TextView设置DrawLeft和DrawRight属性,以实现内容左侧或右侧的自定义绘制,提升UI交互体验。
1878

被折叠的 条评论
为什么被折叠?



