变化的背景下,AlertDialog的文字颜色 [英] Change background, textcolor of AlertDialog

查看:188
本文介绍了变化的背景下,AlertDialog的文字颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图改变的背景文字颜色 AlertDialog的。


windowTitleStyle
:但是我可以改变标题的唯一颜色的android
活动:

AlertDialog.Builder ADB =新AlertDialog.Builder(新ContextThemeWrapper(这一点,R.style.AlertDialogCustom));



styles.xml

样式名称=AlertDialogCustom父=Holo.Theme.Sherlock



我该怎么办呢?谢谢你。


解决方案

  adb.setMessage(Html.fromHtml(<字体颜色=#FF0000>< B>约翰:< / b>< / FONT>+你好吗))?

这是改变文字颜色
你可以创建你自己的对话框
检查此链接
http://www.helloandroid.com/tutorials/how-display-custom-dialog-your-android-application

http://developer.android.com/guide/topics/ui/ dialogs.html

I try to change background and textcolor of AlertDialog.
But I can change only color of title with android:windowTitleStyle

Activity:
AlertDialog.Builder adb = new AlertDialog.Builder(new ContextThemeWrapper(this, R.style.AlertDialogCustom));

styles.xml

style name="AlertDialogCustom" parent="Holo.Theme.Sherlock"


How can I do that? Thanks.

解决方案

adb.setMessage(Html.fromHtml("<font color='#FF0000'><b>John:</b></font>"+"How are you?"))

this is for changing text color You can create you own dialog box check this link http://www.helloandroid.com/tutorials/how-display-custom-dialog-your-android-application

http://developer.android.com/guide/topics/ui/dialogs.html

这篇关于变化的背景下,AlertDialog的文字颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆