1.如果设置成完全透明

在Manifest.xml中给要设置成背景透明的acticity增加属性:android:theme="@android:style/Theme.Translucent"

2.如果想把背景设置成某个颜色

(1)在/value目录下增加文件color.xml

<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="light_drak">#50ffffff</color>
</resources>

(2)在/value目录下增加文件style.xml

<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Transparent">
<item name="android:windowBackground">@color/light_drak</item>
<item name="android:windowIsTranslucent">true</item>
</style>
</resources>

(3)在Manifest.xml中给要设置成背景透明的acticity增加属性:android:theme="@style/Transparent"

这样就可以了

更多相关文章

  1. Android(安卓)修改EditText的光标颜色和背景色
  2. A06_RelativeLayout的属性设置
  3. animation的xml定义中的android:interpolator属性
  4. 在android中增加公用资源包(类似framework-res.apk)
  5. android视图切换动画:ViewAnimator类及其子类
  6. Android之通过shape.xml制作渐变背景色
  7. android:configChanges属性总结
  8. android背景选择器selector用法汇总
  9. android init.rc增加一个自定义的service

随机推荐

  1. android 颜色对应值
  2. Android在标准linux基础上对休眠唤醒的实
  3. Android下载(外文)
  4. Android ViewPager的简单使用
  5. Android Studio build.gradle 编码配置UT
  6. Ubuntu 及windows 环境下android(Launcher
  7. How to start a new process for Android
  8. Android Camera HAL浅析
  9. Android Neon 优化方式讲解
  10. android 对话框集合