android - android - 更改 AlertDialog 后面的模糊背景颜色
问题描述
我想将黑色透明背景更改为白色透明,尝试更改AppTheme
样式但没有成功。
另外我想将黑色模糊背景更改为白色模糊,尝试在AppTheme
样式中进行更改。
我也尝试了这个中提到的renderscript、fastblur、xml ,但它只改变了对话框的白色背景
任何想法如何改变它?提前致谢!
解决方案
使用该样式,您可以更改暗淡而不是模糊。
您可以使用android:backgroundDimAmount
属性(范围:)1.0 - 0.0
:
<style name="ThemeOverlay.App.MaterialAlertDialog" parent="ThemeOverlay.MaterialComponents.MaterialAlertDialog">
<item name="android:backgroundDimAmount">0.xx</item>
</style>
和
MaterialAlertDialogBuilder(context, R.style.ThemeOverlay_App_MaterialAlertDialog)
.setTitle("Title")
.show()
0.10
和_0.90
推荐阅读
- c# - 状态机的统一性能:代表还是条件?
- php - 我如何编写数据库查询代码 Joomla 文章?
- python-3.7 - 如何在 Python 中覆盖打印的一个衬里?
- php - Ajax 多个表单提交加载数据,在使用 PHP 的 div 中,不起作用
- android - Android中的未知状态图标
- python-3.x - 使用来自检查点的动量训练的模型的 TensorFlow 负载权重
- css - iPhone 上不显示背景图像
- python-3.x - 在python的列表中计算相似元素对
- python - 为什么我在 Python 2.7 中的脚本只为一行而不是整个数据集提供地理编码输出?
- node.js - axios 获取实时数据请求