Android sets the background color to transparent, android background color
Set the background color to transparent for android
Method 1:
You only need to add
Android: theme = "@ android: style/Theme. Translucent"
That's all.
In this way, the android transparent style is called!
Method 2:
First, create the colors. xml file under res/values and write:
<? Xmlversion = "1.0" encoding = "UTF-8"?>
<Resources>
<Colorname = "transparent" >#9000 </color>
</Resources>
This value sets the transparency of the entire interface. To see the effect, it is now set to about 56% (9/16.
Create styles. xml under res/values/and set the program style.
<? Xmlversion = "1.0" encoding = "UTF-8"?>
<Resources>
<Stylename = "Transparent">
<Itemname = "android: windowBackground"> @ color/transparent </item>
<Itemname = "android: javaswistranslucent"> true </item>
<Itemname = "android: windowAnimationStyle"> @ + android: style/Animation. Translucent </item>
</Style>
</Resources>
In the last step, use styles. xml on the corresponding Activity. Add any <activity> tag in AndroidManifest. xml
Android: theme = "@ style/transparent"
If you want to set all the activities to use this style, you can add this label statement to <application>.
Finally, run the program. Haha, do you find that the entire interface is covered with a translucent layer. Finally, you can replace the background color #9000 with #0000. After running the program, the background color is completely transparent, and the operations on everything in the visible background are ineffective.
How does android make the background of a dialog transparent?
Is Beijing transparent? You can set the dialog Style through Style;
Android Dialog background transparent and borderless Theme Style
<Style name = "Translucent_NoTitle" parent = "android: style/Theme. Dialog">
<Item name = "android: windowNoTitle"> true </item>
<Item name = "android: background" >#00000000 </item>
<Item name = "android: windowBackground"> @ android: color/transparent </item>
<Item name = "android: colorBackgroundCacheHint"> @ null </item>
<Item name = "android: javaswistranslucent"> true </item>
</Style>
How to make the text box background transparent on the android page
You also need to set the font color. Otherwise, the font and the form background are black and nothing can be seen.
<EditText android: text = "EditText" android: id = "@ + id/editText1"
Android: layout_width = "match_parent"
Android: layout_height = "wrap_content"
Android: background = "@ null"
> </EditText>