可以强调在TextView的文本字 [英] Can underline words in TextView text

查看:157
本文介绍了可以强调在TextView的文本字的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有可能在Android中提供的TextView在Java中code用的setText(文字)函数基本标签,如和 以使标记的文字强调了?

Is there possibility in android to provide TextView some text in Java code with setText(text) function with basic tags like and to make marked words underlined ?

推荐答案

是的,你可以,使用Html.fromhtml()方法:

Yes, you can, use the Html.fromhtml() method:

textView.setText(Html.fromHtml("this is <u>underlined</u> text"));

这篇关于可以强调在TextView的文本字的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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