1, button or ImageButton background transparent or translucent
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); 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
2. Set the background image transparency
Java code:
View v= Findviewbyid (r.id.content);//Find the ID of the layout where you want to set the transparent background
V.getbackground (). Setalpha (100);//0--255 as transparency value