<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 :
WebView view = (WebView)findViewById(R.id.newsView);
view.loadData(htmlString,"text/html","UTF-8");
现在我解决了这些问题,但我还有其他问题:
1)如何设置透明背景以便我可以看到我的应用程序?
2)如何设置前景文本颜色,以便再次看到我的应用程序的颜色?
3)如果有img标签图片不适合view,导致横向滚动。相反,文本完美填充。
最佳答案
关于android - TextView 中的 HTML : problems with frame layout scrolling and image viewing,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12296099/