比如想写一个弹窗 背景是透明的
首先在values/themes.xml中 写一个透明的style
<style name="Theme.TransparentBackground" parent="Theme.项目名称" >
<item name="android:windowBackground"> @color/transparent </item>
</style>
然后再AndroidManifest.xml找到对应的Activity 新增theme属性
<activity
android:name=".ui.home.***Activity"
android:theme="@style/Theme.TransparentBackground"
android:launchMode="singleTask" />