如果您使用的是字符串资源xml文件(支持HTML标记),那么可以使用<b> </b>
、<i> </i>
和<u> </u>
来完成.
<resources>
<string name="your_string_here">
This is an <u>underline</u>.
</string>
</resources>
如果要在代码中的某些内容下面划线,请使用:
TextView tv = (TextView) view.findViewById(R.id.tv);
SpannableString content = new SpannableString("Content");
content.setSpan(new UnderlineSpan(), 0, content.length(), 0);
tv.setText(content);
希望这有帮助