`

透明activity

阅读更多

1、res/values/中新建mystyle.xml文件,内容如下:

<resources> 
 <style name="Transparent"> 
  <item name="android:windowBackground">@color/transparent_background</item> 
    <item name="android:windowNoTitle">true</item> 
    <item name="android:windowIsTranslucent">true</item>   
     <item name="android:windowAnimationStyle">@+android:style/Animation.Translucent</item> 
   </style> 
</resources> 

 

2、res/values/中新建color.xml文件,内容如下:

<?xml version="1.0" encoding="utf-8"?> 
   <resources> 
    <color name="transparent_background">#50000000</color> 
  </resources> 

 

3、AndroidManifest.xml中引用1中新建样式

<activity android:name="touch" android:theme="@style/Transparent"/>

 

则activity变为透明的了,呵呵

 

分享到:
评论
发表评论

文章已被作者锁定,不允许评论。

相关推荐

Global site tag (gtag.js) - Google Analytics