Android的:在ListView中getCount将()和getChildCount()之间的区别 [英] Android: Difference between getCount() and getChildCount() in ListView

查看:265
本文介绍了Android的:在ListView中getCount将()和getChildCount()之间的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

之间是什么 getCount将() getChildCount()的ListView

推荐答案

getCount将()返回项目的适配器计数(总在列表),getChildCount()是一种方法的ViewGroup可以返回子视图的数量。 ListView的积极重用的意见,所以如果您的列表中有1000个项目getCount将()将返回1000,getChildCount() - 约10左右...

getCount() returns you a count of items in Adapter (total in list), getChildCount() is a ViewGroup method that returns you number of subviews. ListView actively reuses views so if your list has 1000 items getCount() will return 1000, getChildCount() - around 10 or so...

这篇关于Android的:在ListView中getCount将()和getChildCount()之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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