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>
本文介绍如何通过两种方式实现Android应用中的透明效果:一是利用系统提供的主题,二是自定义主题样式来达到窗口背景透明的目的。
731

被折叠的 条评论
为什么被折叠?



