gpt4 book ai didi

android - 警报对话框背景色

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

我正在使用具有自定义布局的 AlertDialog。布局中TextView的颜色是黑色的,所以在Android 4.0上用Holo.Light打开对话框时,文字是可见的。但是,如果您在 Android 2.2 中打开对话框,由于背景为灰色,文本将不可见。有没有办法改变背景颜色?

最佳答案

However if you open the dialog in Android 2.2 the text is not visible because of the gray background. Is there a way to change the background color?

是的,这是可能的,我使用 DialogBu​​ilder 在我的应用程序中使用了它。只需将 inverseBackgroundForced 设置为 true

builder.setInverseBackgroundForced(true);
AlertDialog dialog = builder.create();
dialog.show();

在你的对话框生成器上。在 Froyo 之前的 android 版本上,它将强制背景为白色(而不是深灰色)。

关于android - 警报对话框背景色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14482092/

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