具有额外背景的Android警报对话框

我最近将我的应用程序迁移到了Material Design,我用我的警报对话框偶然发现了这个问题:

我正在应用这样的对话框样式:

< item name =“android:alertDialogTheme”> @ style / Theme.AlertDialog< / item>

和Theme.AlertDialog看起来像这样:

<style name="Theme.AlertDialog" parent="Base.V14.Theme.AppCompat.Dialog">
    <item name="colorPrimary">@color/theme_primary</item>
    <item name="colorPrimaryDark">@color/theme_primary_dark</item>
    <item name="colorAccent">@color/theme_accent_dark</item>
</style>

这是在我的Kitkat设备上发生的,它在Lollipop上工作正常.你能帮助我摆脱那个外在的背景吗?

解决方法

重点是:
<style name="Theme.AlertDialog" parent="Base.V14.Theme.AppCompat.Dialog">
    ...
    <item name="colorPrimary">@color/theme_primary</item>
    <item name="colorPrimaryDark">@color/theme_primary_dark</item>
    <item name="colorAccent">@color/theme_accent_dark</item>
    ...
    <item name="android:windowBackground">@android:color/transparent</item>
    ...
</style>

相关文章

Android性能优化——之控件的优化 前面讲了图像的优化,接下...
前言 上一篇已经讲了如何实现textView中粗字体效果,里面主要...
最近项目重构,涉及到了数据库和文件下载,发现GreenDao这个...
WebView加载页面的两种方式 一、加载网络页面 加载网络页面,...
给APP全局设置字体主要分为两个方面来介绍 一、给原生界面设...
前言 最近UI大牛出了一版新的效果图,按照IOS的效果做的,页...