如何提高ListView的性能? [英] How do I improve the performance of a listview?
问题描述
当我在使用图片来自互联网列表视图
,我的列表视图
滚动很慢。结果
但是,在某些应用中,如Twitter,谷歌以及其他应用程序(尽管显示图片来自互联网)有一个与滚动没有问题,这是非常快速和流畅。
When I use images from the internet in a Listview
, my Listview
scrolls very slowly.
But in some applications such as Twitter, Google+ and other applications (despite showing images from the internet) there is no problem with scrolling and it is very fast and smooth.
如何提高性能的列表视图
与图像?
How do I improve the performance of a Listview
with images?
推荐答案
有一些ThumbRules这可能会帮助您优化列表视图:
There are some ThumbRules which might help you in optimizing listview:
- >使用ConvertView,在重用视图
-> Reuse Views by using ConvertView, in
`getView(AdapterView<?> adapterView, View convertView, int position, long id)`
- >。从网页使用延迟加载加载图像,请参阅
->. Use Lazy Loading for Loading images from web, see
<一个href=\"http://$c$chenge.net/blog/2011/06/android-development-tutorial-asynchronous-lazy-loading-and-caching-of-listview-images/\" rel=\"nofollow\">http://$c$chenge.net/blog/2011/06/android-development-tutorial-asynchronous-lazy-loading-and-caching-of-listview-images/
- >还可以使用ViewHolders来提高通胀time.check链接:
-> Also use ViewHolders to improve inflation time.check link:
http://jmanzano.me/efficient-listviews-in -Android-viewholder图案-2 /
这篇关于如何提高ListView的性能?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!