How to remove drawableleft

The drawableLeft (or any of the similar attributes) XML attribute can be modified (removing a drawable in your case) via code using something like this:

yourTextView.setCompoundDrawablesWithIntrinsicBounds(0, 0, 0, 0);
yourTextView.setText("The Text You Need In There");

The constructor for the method is in this order:

setCompoundDrawablesWithIntrinsicBounds (int left, int top, int right, int bottom)

Read more about the method setCompoundDrawablesWithIntrinsicBounds here


We can sets the Drawables (if any) to appear to the left of, above, to the right of, and below the text.

Use 0 or null if you do not want a Drawable there.

 textView.setCompoundDrawablesWithIntrinsicBounds(0, 0, 0, 0);

The Drawables' bounds will be set to their intrinsic bounds.

Calling this method will overwrite any Drawables previously set using {@link #setCompoundDrawablesRelative} or related methods.

And if we wants to set Drawables then we can use :

textView.setCompoundDrawablesWithIntrinsicBounds( R.drawable.smiley, 0, 0, 0);