In the xml you can set a drawable to the left, right, bottom or top of the text in TextView. Is there a way to set / change this drawable through a code?
TextView textView = (TextView)findViewById(R.id.myTxtView);
textView.setCompoundDrawablesWithIntrinsicBounds(
R.drawable.icon, //left
0, //top
0, //right
0);//bottom
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With