是否可以将HTML文件加载到Android中的TextView中? [英] Is it possible to load a HTML file into a TextView in Android?

查看:246
本文介绍了是否可以将HTML文件加载到Android中的TextView中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的应用程序中,我正在将html文档(包含:用于显示方程式的代码,对库的引用)加载到Web视图中.

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代码嵌入到textview中?

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆