gpt4 book ai didi

android - 对话框中 EditText 的全息主题

转载 作者:行者123 更新时间:2023-11-29 21:57:54 25 4
gpt4 key购买 nike

我有一个对话框,其中有 2 个编辑文本,一个标题和评论..我想要 holo 主题中的这个编辑文本。请任何人帮助我解决这个问题

最佳答案

使用这个:

AlertDialog.Builder builder = new AlertDialog.Builder(new 
ContextThemeWrapper(this, R.style.AlertDialogCustom));

Becoz android 使用 ContextThemeWrapper 来设置对话框的样式。

确保在资源中定义您的自定义样式:

<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="AlertDialogCustom" parent="@android:style/Theme_Holo_Dialog">
<item name="android:textColor">#FFFF00</item>
<item name="android:typeface">monospace</item>
<item name="android:textSize">18sp</item>
</style>
</resources>

您可以在这里获得更多主题:http://developer.android.com/reference/android/R.style.html

关于android - 对话框中 EditText 的全息主题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12745075/

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