Android ListView的起始索引(位置)是什么,0还是1
萨拉姆Android ListView的起始索引(位置)是什么,0还是1,android,android-listview,Android,Android Listview,萨拉姆 简单问题:Android ListView的起始索引(位置)是0还是1 list.getChildAt(index); 注意:第一个索引始终以0开头 因此list.getChildAt(index)将返回索引0处的第一个子级,索引1处的下一个子级,依此类推 但是,根据您的开始循环,您可以从任何方式开始获取任何子级 for(int i = 0;i< listview.size();i++) { //you get the first child as starting poin
简单问题:Android ListView的起始索引(位置)是0还是1
list.getChildAt(index);
注意:第一个索引始终以0开头 因此
list.getChildAt(index)
将返回索引0处的第一个子级,索引1处的下一个子级,依此类推
但是,根据您的开始循环,您可以从任何方式开始获取任何子级
for(int i = 0;i< listview.size();i++)
{
//you get the first child as starting point in a loop
list.getChildAt(index); //the start index is 0 here.
}
for(int i = 1;i< listview.size();i++)
{
//you get the second child as starting point in a loop
list.getChildAt(index); //the start index is 1 here.
}
for(int i=0;i
公共视图getChildAt(int索引)
在API级别1中添加
返回组中指定位置的视图
参数
索引从中获取视图的位置
返回
- 位于指定位置的视图,如果组中不存在该位置,则为null
list.getChildAt(index)
将返回索引0处的第一个子级,索引1处的下一个子级,依此类推
但是,根据您的开始循环,您可以从任何方式开始获取任何子级
for(int i = 0;i< listview.size();i++)
{
//you get the first child as starting point in a loop
list.getChildAt(index); //the start index is 0 here.
}
for(int i = 1;i< listview.size();i++)
{
//you get the second child as starting point in a loop
list.getChildAt(index); //the start index is 1 here.
}
for(int i=0;i
公共视图getChildAt(int索引)
在API级别1中添加
返回组中指定位置的视图
参数
索引从中获取视图的位置
返回
- 位于指定位置的视图,如果组中不存在该位置,则为null