android ProgressDialog fontSize change

无人久伴 提交于 2019-12-09 13:23:18

问题


Is it possible to change the font size and make text bold which is displayed in a ProgressDialog .I have created a ProgressDialog like this:

private ProgressDialog dialog;
this.dialog = ProgressDialog.show(Activity.this, "Heading","Message...", true);

I want to make Heading bold and increase the font size..pls help


回答1:


If you import android.text.Html; then you will be able to use the Html.fromHtml() method to do it, like so:

private ProgressDialog dialog;
this.dialog = ProgressDialog.show(Activity.this, Html.fromHtml(
               "<b>Heading<b>"), Html.fromHtml("<big>Message...</big>"), true);

You should also be able to use other Html text formatting tags like <small> <u> <i> <sub> etc., and obviously you can mix and match them like any other html text.



来源:https://stackoverflow.com/questions/6595390/android-progressdialog-fontsize-change

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!