Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在 xml 中,您可以在 TextView 中的文本的左侧、右侧、底部或顶部设置可绘制对象。有没有办法通过代码设置/更改这个drawable?
TextView textView = (TextView)findViewById(R.id.myTxtView); textView.setCompoundDrawablesWithIntrinsicBounds( R.drawable.icon, //left 0, //top 0, //right 0);//bottom