assigning large string to textview.settext hangs UI

ぐ巨炮叔叔 提交于 2020-03-23 06:32:51

问题


I'm trying to show very large text (of length 850879) in textview, unfortunately when I assign text to textview, UI hangs for 8-15 seconds! How do we fix this issue? any idea?


回答1:


Use Webview....instead of textview. Textview is not design to load large text.

WebView webView;
String html;
webView.loadDataWithBaseURL("", html, "text/html", "UTF-8", "");



回答2:


Can you spilt the text in small chunks and provide it to a list view... That way ui will not be blocked for what's not visible



来源:https://stackoverflow.com/questions/22671025/assigning-large-string-to-textview-settext-hangs-ui

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!