美文网首页
自定义Dialog 背景不变暗/xml 设置match_pare

自定义Dialog 背景不变暗/xml 设置match_pare

作者: Marlon_IT | 来源:发表于2021-09-07 15:54 被阅读0次

1. 自定义dialog的的theme

<style name="CustomDialog" parent="@android:style/Theme.Dialog">
         <!-- 设置dialog背景颜色 --> 
         <item name="android:windowBackground">@android:color/transparent</item>
        <!--说明提示框是否有边框-->
        <item name="android:windowFrame">@null</item>
        <!--无标题-->
        <item name="android:windowNoTitle">true</item>
         <!--是否浮现在activity之上 设置true match_parent 无效,false 有效-->
        <item name="android:windowIsFloating">false</item>
        <!--提示框是滞是透明的-->
        <item name="android:windowIsTranslucent">false</item>
        <!-- 背景是否模糊显示。为true则充许模糊(变暗)-->
        <item name="android:backgroundDimEnabled">true</item>
        <!-- 设置模糊的程度-->
        <item name="android:backgroundDimAmount">0.4</item>
</style>

相关文章

网友评论

      本文标题:自定义Dialog 背景不变暗/xml 设置match_pare

      本文链接:https://www.haomeiwen.com/subject/ghqpwltx.html