简体   繁体   English

由fromHtml()Android编写的textView中的字体标签

[英]font tag in textView by fromHtml() android

Hi i am using tag in text view as follows: 嗨,我在文本视图中使用标签,如下所示:

textViewobj.setText(Html.fromHtml("<font size=\"40\" face=\"arial\" color=\"red\">ggg</font><br><br>"));

It makes the text red but neither size attribute works nor face works. 它使文本变成红色,但是size属性和face都不起作用。 I am really struggling with this issue. 我真的在这个问题上挣扎。 Actually i want to show html formatted text in email body by using email intent. 实际上,我想通过使用电子邮件意图在电子邮件正文中显示html格式的文本。 There is no way achieve this but to use fromHtml(). 除了使用fromHtml(),没有其他方法可以实现此目的。

为有效起见,设备上必须存在一种字体,如果您使用的是arial字体,则应将其安装在设备上,以指定字体大小,并使用带有数字的px(例如40px)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM