Translucent <button android:background= "#e0000000" .../>
Transparent <button android:background= "#00000000" .../>
The color and opacity (alpha) values are represented by hexadecimal notation. The range of values for any one color is 0 to 255 (00 to FF). For alpha,00, full transparency is expressed, and FF is completely opaque. The expression order is "Aabbggrr", where Aa=alpha (00 to FF), Bb=blue (00 to FF), Gg=green (00 to FF), and rr=red (00 to FF). For example, if you want to apply a blue 50% opacity to an overlay, you should specify the following values: 7fff0000
Java code
View v = Findviewbyid (r.id.content);//Find the ID of the layout you want to set the transparent background
V.getbackground (). Setalpha (100),//0~255 transparency value, 0 is fully transparent, 255 is opaque
How Android sets the transparency of the background