Which One To Use Webview Or Textview In A List With Html Data In It?
Solution 1:
WebView
does not work well as a child of ListView
, since both WebView
and ListView
know how to scroll. Hence, I would use TextView
. Limit your HTML to the tags that Html.fromHtml()
supports. Here is a list of supported tags from Android 2.1, and other versions of Android are probably similar.
With respect to performance, TextView
is indeed a significantly lighter widget and would perform better in any case. You may want to cache your Html.fromHtml()
output, though, so you do not have to re-do that for a given row as the user scrolls.
Solution 2:
As a perfromance comparison ,I tried both of them but WebView with huge data is incredibily slow , my custom adapter could not even finish drawing until user respond to interface on the other hand textview is doing pretty good as a performance , i recommend using textview unless you need to do lots of html work inside text.
Post a Comment for "Which One To Use Webview Or Textview In A List With Html Data In It?"