Android:如何加快 GridView 的滚动速度? [英] Android: How can I speed up the scrolling of GridView?

查看:31
本文介绍了Android:如何加快 GridView 的滚动速度?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 GridView 显示图像(7 列 166dp x 249dp 的图像),它们的大小都相同(有超过 150 张图像),我正在通过视图持有者模式使用视图回收机制适配器的方式.我的观点都是简单的 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?

推荐答案

我在上次 Google Developer Lab 期间与 Google 的一些男孩进行了交谈,他们告诉我 GridView 没有得到很好的维护,我应该使用 ListView,自己在代码中布置行以制作网格.这就是我所做的,现在速度快如闪电.

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.

这篇关于Android:如何加快 GridView 的滚动速度?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆