<分区>
Possible Duplicate:
How to display HTML in TextView?
我有一个包含一些标签(<p>
、<img>
等)的字符串。
讲述如何在textview中处理这些标签。
提前致谢。
标签 android
<分区>
Possible Duplicate:
How to display HTML in TextView?
我有一个包含一些标签(<p>
、<img>
等)的字符串。
讲述如何在textview中处理这些标签。
提前致谢。
最佳答案
textView.setText(Html.fromHtml("<p>" + title + "</p>");
您还可以使用网页 View
WebView webview = new WebView(this);
setContentView(webview);
// Simplest usage: note that an exception will NOT be thrown
// if there is an error loading this page (see below).
webview.loadUrl("http://slashdot.org/");
// Of course you can also load from any string:
String summary = "<html><body>You scored <b>192 points.</body></html>";
webview.loadData(summary, "text/html", "utf-8");
http://developer.android.com/reference/android/webkit/WebView.html
关于android - 如何在android中的textview上获取一个值作为htmltext?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2147050/