第一步
colors.xml添加<color name="translucent_background">#E0000000</color>
第二步
styles.xml添加
<style name="translucent">
<item name="android:windowBackground">@color/translucent_background</item>
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowAnimationStyle">@android:style/Animation.Translucent</item>
</style>
第三步
manifest.xml中对应的Activity下添加android:theme="@style/translucent"
OK,三步搞定
如果想设置透明度,只需修改红字部分,试一试#00000000,#90000000,#F0000000,#99990000
#50000000前两位是透明的效果参数从00--ff(透明--不透明),后6位是RGB颜色的设置