TextView txtShuoming; SpannableStringBuilder builder =
new SpannableStringBuilder(getResources().getString(R.string.shuoming));
//1.设置字体颜色
builder.setSpan(new ForegroundColorSpan(Color.BLUE), 47,56, Spannable.SPAN_EXCLUSIVE_INCLUSIVE);
//2.设置字体风格
builder.setSpan(new StyleSpan(android.graphics.Typeface.BOLD), 237, 241,Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
txt.setText(builder);
//3.设置下划线txt.setText(Html.fromHtml("<u>"+ getResources().getString(R.string.shuoming) + "</u>"));
TextView 下划线/字体/颜色,布布扣,bubuko.com
原文地址:http://blog.csdn.net/u012252502/article/details/25705331