只是想知道我需要如何格式化 android.widget.TextView 文本,以便
<p> does not show </p> // the <p> symbol should not be shown.
谢谢
只是想知道我需要如何格式化 android.widget.TextView 文本,以便
<p> does not show </p> // the <p> symbol should not be shown.
谢谢
来自 Html 类。您可以使用,
Html.FromHtml(<Html String>);
还支持标签类型,请看这个..
http://commonsware.com/blog/Android/2010/05/26/html-tags-supported-by-textview.html
例子:
String htmlString = "<p> does not show </p>";
textView.setText(Html.FromHtml(htmlString));
用这个
textview.setText(Html.fromHtml("YOUR STRING"));
将字符串定义为:
<resource>
<string name="your_string">This is an <p>paragraph</p> text demo for TextView.</string>
</resources>