在android中的Html.fromhtml方法,可以将比如文本 框中的字符串进行HTML格式化,支持的还是很多的, 但要注意的是要在string.xml中用<!--cdata-->去转义,比如: Java代码 <string name=" htmlFormattedText"> <![CDATA[ Text with markup for [b]bold[/b] and [i]italic[/i] text. There is also support for a <tt>teletype-style</tt> font. But no use for the <code>code</code> tag! ]]></string> 对应的 Java代码 TextView view = (TextView)findViewById(R.id.sampleText); String formattedText = getString(R.string.htmlFormattedText); Spanned result = Html.fromHtml(formattedText); view.setText(result); 或: view.setText(Html.fromHtml("<u>我爱你>"));