用Html来格式化字符,例如要实现如下的显示:"这只是一个测试字符串,测试黑体字、斜体字、下划线、红色字的显示。"可以将字符串格式化成Html格式,如下: String source = "这只是一个测试字符串,测试<b>黑体字</b>、<i>斜体字</i>、<u>下划线</u>、<font color='red'>红色字</font>的显示。"; 然后调用TextView里面setText函数即可 textView.setText(Html.fromHtml(source)); 高亮显示方法: String str="adsjoiasdjpaisdjpaidj"; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.laychangerout.main); textview=(TextView)findViewById(R.id.textview); SpannableStringBuilder style=new SpannableStringBuilder(str); style.setSpan(new ForegroundColorSpan(Color.RED),3,8,Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); textview.setText(style); changer }