Set drawable opacity Set drawable opacity android android

Set drawable opacity


You can use Drawable's setAlpha() method. It takes an int from 0 to 255, 0 being fully transparent, and 255 being fully opaque.

See the developer reference here.


0 means fully transparent, and 255 means fully opaque:

(drawable).getBackground().setAlpha(int alpha);