如果您使用的是支持<b></b>
、<i></i>
和<u></u>
等HTML标记的string resourceXML文件,则可以实现这一点.
<resources>
<string name="your_string_here">This is an <u>underline</u>.</string>
</resources>
如果要在代码中的某些内容下面划线,请使用:
TextView textView = (TextView) view.findViewById(R.id.textview);
SpannableString content = new SpannableString("Content");
content.setSpan(new UnderlineSpan(), 0, content.length(), 0);
textView.setText(content);