<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<TextView
android:id="@+id/htmlText"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:textColor="#FFCC00" />
</FrameLayout>
If I set textview’s text like this:
setText(Html.fromHtml(htmlString));
scroll does not work.
Moreover, if in html there’s an img tag, image is not viewed..why?
edit:
I switched to webview:
WebView view = (WebView)findViewById(R.id.newsView);
view.loadData(htmlString,"text/html","UTF-8");
and now I solved these problems, but I still got others:
1)How to set transparent background so I can see my app’s one?
2)How to set foreground text color so, again, I can see my app’s colors?
3)If there’s an img tag image does not fit the view, leading to an horizontal scrolling. Text, instead, perfectly fills.
If you want to display HTML content, use
WebView.TextViewsupports only limited set of HTML tags – mainly for formatting text.