gpt4 book ai didi

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

转载 作者:塔克拉玛干 更新时间:2023-11-02 19:17:06 25 4
gpt4 key购买 nike

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

dialog appears to be having two backgrounds and I don't know how to get rid of the outer background

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

<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 警报对话框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29406902/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com