<style name="CustomDialogStyle" parent="@android:style/Theme.Dialog">
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:windowNoTitle">true</item>
<item name="android:backgroundDimEnabled">true</item>
</style>关键是最后一个属性android:backgroundDimEnabled,设置为true时候,整个Dialog的大背景就是半透明的黑色,如果设置为false就是全透明。
Dialog整个窗体背景设置为透明
最新推荐文章于 2024-09-27 09:08:35 发布
本文介绍了一种在Android中创建带有透明背景的自定义对话框的方法。通过设置样式属性android:backgroundDimEnabled为true,可以使对话框背景呈现半透明黑色效果;若设为false,则背景全透明。

5412

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



