Html和设置文本转换为TextView的 [英] Convert Html and Set text to Textview
问题描述
我想转换一个HTML字符串,并将其设置为一个TextView,但我不能这样做完全。
I am trying to convert a html String and set it to a TextView but I couldn't do it exactly.
下面是我的字符串,你好,%1 $ S您有<!B>%2 $ D新消息< / B>
我使用的 textview.setText(Html.fromHtml(myString中)); 产生我与HTML标签,而不是纯文本的输出。谁能帮我这个?
I am using textview.setText(Html.fromHtml(myString)); which produces me an output with Html Tags instead of plain text. Can anyone help me with this?
任何帮助是非常AP preciated。 谢谢
Any help is much appreciated. Thanks
推荐答案
尝试使用<一个href="http://developer.android.com/reference/android/widget/TextView.html#setText%28java.lang.CharSequence,%20android.widget.TextView.BufferType%29"相对=nofollow>这个的版本的setText和使用SPANNABLE缓冲类型
Try use this version of setText and use SPANNABLE buffer type
这篇关于Html和设置文本转换为TextView的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!