Android settings activity background for transparent style

Source: Internet
Author: User
Tags transparent color

Method One:

by theme.translucent

@android: Style/theme.  Translucent            @android: Style/theme.  Translucent. @android: Style/theme.  Translucent. Notitlebar. fullscreen         

Only need to be in the manifest in the activity of transparent set theme for any of the above can be

<ActivityAndroid:name= "COM.VIXTEL.SIMULATE.MAINAPP"Android:configchanges= "Keyboardhidden|orientation"Android:label= "@string/app_name " android:screenorientation= "portrait"  android:theme= "@ Android:style/theme.translucent.notitlebar "> < Intent-filter> <action  Android:name= "Android.intent.action.MAIN"/> << Span class= "title" >category android:name= " Android.intent.category.LAUNCHER "/> </ intent-filter> </ACTIVITY>       

Method Two:

Custom style, like the custom dialog style, adds a transparent color value to the Res-values-color.xml:

<?xml version= "1.0" encoding= "UTF-8"?><resources>    <name="Transparent" > #0000</color></resources>        

Add the following in Res-values-styles.xml:

<style name="Mytransparent" ><item name= "Android:windowbackground" > @color/ Transparent</item> <item span class= "attribute" >name= "Android:windownotitle" >true</item> <item name=  "android:windowistranslucent" >true</item> span class= "tag" ><item name= "Android: Windowanimationstyle "> @android: Style/animation.translucent</item > </STYLE>         

In manifest, you need transparent activity settings theme for our custom

Android:theme="@style/mytransparent" 

After running the program, it's all transparent, and seeing everything in the background can be ineffective.

Android settings activity background for transparent style

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.