是否可以将 HTML 文件加载到 Android 中的 TextView 中? [英] Is it possible to load a HTML file into a TextView in Android?
本文介绍了是否可以将 HTML 文件加载到 Android 中的 TextView 中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在我的应用程序中,我将一个 html 文档(包含:显示方程的代码、对库的引用)加载到 webview 中.
In my app I am loading a html document (contains: the code to display an equation, reference to libraries) into a webview.
问题是加载仍然需要一些时间,而且感觉不是很流畅.我已经连接了一个进度条,让它更活泼一些.
The problem is that it still takes some time to load and it does not feel very smooth. I already hooked up a progressbar to make it a little snappier.
我只是想知道,是否可以将该 html 文件加载到 textview 中?或者我可以将该html代码嵌入到文本视图中吗?
I am just wondering, would it be possible to load that html file into a textview? Or can I embed that html code in a textview?
推荐答案
是的,这是可能的:
textView.setText(Html.fromHtml(myHTMLString));
这篇关于是否可以将 HTML 文件加载到 Android 中的 TextView 中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文