Set drawable opacity

james picture james · Oct 18, 2010 · Viewed 17k times · Source

How can i set the opacity of a Drawable object?

Answer

Kevin Coppock picture Kevin Coppock · Oct 18, 2010

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.