Get all ListView items(rows)

前端 未结 4 1178
孤街浪徒
孤街浪徒 2020-12-17 22:53

How may I get all children of an item of ListView ?
There are methods to get child at position but I was not able to find any method which returns collectio

4条回答
  •  一生所求
    2020-12-17 23:22

    I guess if your items in the ListView are of type ViewGroup you could do the following

    ArrayList children = new ArrayList();
    for (int i = item.getChildCount() - 1 ; i>=0; i--) {
        children.add(item.getChildAt(i));
    }
    

提交回复
热议问题