2 ways Android Settings activity background color is transparent

Source: Internet
Author: User

Android set background color to transparent

Method One:

As long as the activity property is configured within the configuration file, add

Just fine.

This invokes the Android transparent style!

Method Two:

First build the Colors.xml file under Res/values, write:
  
  

<? xmlversion= "1.0" encoding= "UTF-8 " ?> < Resources > < ColorName = "Transparent" >#9000</color></resources>             


  
This value sets the transparency of the entire interface, and is now set to about 56% (9/16) of the transparency to see the effect.
  
Then build Styles.xml under Res/values/, set the style of the program
  

<?xmlversion= "1.0" encoding= "Utf-8 "?>      <Resources>     <stylename= "Transparent">      <Itemname= "Android:windowbackground">@color/transparent</Item>      <Itemname= "Android:windowistranslucent">True</Item>      <Itemname= "Android:windowanimationstyle">@+android:style/animation.translucent</Item>      </style>      </Resources>

  
The last step is to use this styles.xml in the corresponding activity. That is, add any <activity> tags in the androidmanifest.xml
  
  

Android:theme= "@style/transparent"


  
If you want to set all the activity to use this style, you can add this tag statement in <application>.
  
Finally run the program, is not found that the entire interface is covered with a layer of translucent. Finally can change the background color #9000 to #0000, after running the program, it is completely transparent, see the background of all things can be invalid operation.

Android settings 2 ways to have activity background color transparent

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.