Expand all children in expandable list view

后端 未结 5 1685
谎友^
谎友^ 2020-12-15 02:21

I would like to expand all children while the expandable list view is populated. Currently my code looks like this:

ExpandableListView listView = (Expandable         


        
5条回答
  •  误落风尘
    2020-12-15 03:07

    Expanding all groups

    for(int i=0; i < myAdapter.getGroupCount(); i++)
        myExpandableListView.expandGroup(i);
    

    if you wish to make them unCollapseable.

    myExpandableListView.setOnGroupClickListener(new OnGroupClickListener() {
      @Override
      public boolean onGroupClick(ExpandableListView parent, View v,int  groupPosition, long id) { 
        return true; 
      }
    });
    

提交回复
热议问题