Android Set alpha


Example

"alpha" is used to specify the opacity for an image.

set alpha using XML attribute:

android:alpha="0.5"  

Note: takes float value from 0 (transparent) to 1 (fully visible)

set alpha programmatically:

imgExample.setAlpha(0.5f);

enter image description here