1. 使用系统提供的activity主题
在manifest文件中的activity 标签下设置 android:theme="@android:style/Theme.Translucent"
2. 自定义主题样式,设置对应的activity 对应的window背景颜色为透明
<?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>