<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>
如果我这样设置 textview 的文本:
setText(Html.fromHtml(htmlString));
滚动不起作用。此外,如果在 html 中有一个 img 标签,则不会查看图像..为什么?
编辑:
我切换到网络视图:
WebView view = (WebView)findViewById(R.id.newsView);
view.loadData(htmlString,"text/html","UTF-8");
现在我解决了这些问题,但我还有其他问题:
1)如何设置透明背景以便我可以看到我的应用程序?
2)如何设置前景文本颜色,以便再次看到我的应用程序的颜色?
3)如果有一个img标签图像不适合视图,导致水平滚动。相反,文本完美填充。