2015-07-28 96 views
0

文本视图 当我尝试从网上得到的文本和文本中显示它查看它生成的HTML标签Android的文本视图显示html标签的文本

男孩:你怎么样
女孩:&nbps;细

有没有办法消除从文本视图这些文字

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="fill_parent" 
    android:layout_height="match_parent" 
    android:layout_gravity="center" 
    android:orientation="horizontal" > 



    <TextView 
     android:id="@+id/jokeText" 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:textSize="20dp" 
     android:textColor="#DC143C" 
     android:paddingLeft="20dp" 
     android:paddingTop="10dp" 
     android:text=""/> 


</LinearLayout> 

我需要帮助请解决这个问题。

回答

1

jokeText.setText(Html.fromHtml(“&nbps; fine”));

+0

是的。我也会写同样的答案。 –

+0

感谢兄弟在文本视图中有一个变量集,我从网上获得。我想我的文本免费的HTML标记 –

+0

public String removeHtml(String html){ return Html.fromHtml(your_html_text).toString(); } – Renjith