简体   繁体   中英

How can I have a listview item that only has a webview in it?

I couldn't find any way to do it. I need a listview item that is just a webview. Any ideas on how i can do this?

You should never do this. First it would be a ScrollView inside a ScrollView which can seriously mess with scrolling. And secondly the WebView is a huge object and requires a high amount of memory. You should never use a WebView inside a ListView as there could be many WebView instances around at the same time which will consume a high amount of memory therefore increasing load times and this will make the list scrolling sluggish and unresponsive.

You can display simple html content with a TextView, like this:

textView.setText(Html.fromHtml(htmlContent));

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM