安卓:我怎样才能加快GridView控件的滚动?控件、GridView

2023-09-08 08:32:03 作者:拿根辣条砸死你

我有一个显示的都是一样的大小(有超过150图像)的图像(即是166dp x 249dp图像的7列)一个GridView和我使用过的观点持有者模式的看法回收机制适配器的方式。我的观点都只是ImageViews。没有太多的事情,应该在这个小部件减缓滚动(有一次21的图像在屏幕上),但事情只是滚动,以便震荡。我能做些什么来加快步伐?

I have a GridView that displays images (7 columns of images that are 166dp x 249dp) that are all the same size (there are over 150 images), and I'm using the view recycling mechanism through the view holder pattern by way of an adapter. My views are all simply ImageViews. There isn't much going on that should be slowing the scrolling on this widget (there are 21 images on screen at a time), but the thing just scrolls so choppy. What can I do to speed it up?

推荐答案

我跟一些男孩在谷歌的最后的谷歌开发者实验室时,他们告诉我说,GridView控件不保持非常多,我应该使用的ListView ,奠定了自己的行code键使电网。这是我做的,它现在快如闪电。

I spoke with some of the boys at Google during the last Google Developer Lab and they told me that GridView is not maintained very much, and that I should use ListView, laying out the rows myself in code to make a grid. This is what I did and it's now lightning fast.