-
Take a look at the following examples.
Example: <>
Workaround: Add the following styles to your values file (if you don't have one, create it). Here's a complete document:
Values @color transparent color values 00000000 I put res values file. Later versions of Android define a transparent color, so you can use the color with the version @android:Color transparent directly in style and jump.
xml (note an extra step android: in definition)).
Then apply the style to your activity, for example:
-
Android Studio finds the corresponding activity and adds android:theme= to it"@android:style/"The background is transparent, and if you want to cancel the title bar and full-screen painting, you can change the style.
-
1. Open the Android configuration file.
2. You only need to set the style of the activity that needs to be set to transparent in the configuration file to android:theme="@android:style/"
3. This way you can set the background to transparent.
Here's how to customize the theme, make the activity transparent and untitled.
Step 1: color file.
The first two digits are transparency, and the lower the value, the better the transparency.
Step 2: style file.
Step 3: Manifest file. Cite.
-
Take Android Studio as an example, the steps are as follows:
1. Open the relevant window directly, right-click in the blank space of android-app-res-layout and select new-layout resource file.
2. Next, a new page will pop up, and you need to enter the name to create a new resource file.
3. At this time, if there is no problem, jump through the object.
4. After the above operations are completed, continue to add android:background="#50ffffff"Make sure.
5. In this way, you will get the graphical result, and you can make the background of the control transparent.
-
A completely transparent activity has a lot of uses, for example, when the application is launched, it can be used to deal with the situation of jumping to the corresponding interface according to the status of whether the user is logged in, in fact, WeChat does this effect when it is launched, or when the server detects the version update, it pops up a vertical hand to display the dialog box, and it can also change a lot of tricks to cleverly solve different needs, and it is very simple to achieve such an activity. We only need one style to solve it perfectly:
In, add:
Into set the theme:
Start this activity, you can't see anything, you can only see the desktop.