1. 最简单的方式就是通过修改TextView的字符串值,即在string里添加关键字<u>:
<string name="register_by_phone"><u>手机注册</u></string>
2.在代码里通过SpannableString方式:
TextView regPhoneTextView;
.....
String regPhoneTxt = getString(R.string.register_by_phone);
SpannableString regPhoneSpanText = new SpannableString(regPhoneTxt);
regPhoneSpanText.setSpan(new UnderlineSpan(), 0, regPhoneTxt.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
regPhoneTextView.setText(regPhoneSpanText);