有多少项目一个ListView可以存储? [英] How many items a ListView can store?

查看:84
本文介绍了有多少项目一个ListView可以存储?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是新来的Andr​​oid编程。我不知道一个ListView能有多少项存储?我的文档搜索,但他们不谈论这一点。如果我放了很多(也许10K)项目成ListAdapter,是否会影响到性能?

I'm new to Android programming. I wonder how many items a ListView can store? I search in docs but they don't talk about this. What if I put a lot (maybe 10k) items into a ListAdapter, will it affect to the performance?

干杯,
MK。

Cheers, MK.

推荐答案

ListView控件采用的是Android虚拟化。实际地说,这意味着,有一个为它里面的元素的数量没有实际限制。你可以把数百万行的名单内,它会只为当前可见的人(或几个顶部)分配内存。

The ListView is virtualized in Android. Practically speaking, that means that there's no actual limit for the number of elements inside it. You can put millions of rows inside the list and it'll only allocate memory for the currently visible ones (or a few more tops).

检查出几十个关于编写自定义适配器类一个AdapterView教程(ListView的扩展了)。还检查了在列表视图的谷歌I / O 2010大会;它真的有用:这里

Check out the dozens of tutorials regarding writing a custom Adapter class for an AdapterView (ListView extends that). Also check out the Google I/O 2010 session on ListViews; it's really useful: here

这篇关于有多少项目一个ListView可以存储?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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