Expandable ListView

后端 未结 3 1655
[愿得一人]
[愿得一人] 2020-12-18 01:30

I am using expandableListView for UI design, so I am wondering for Android expandable listview, is there a way to allow only one list item expanded, i.e. when you click and

3条回答
  •  爱一瞬间的悲伤
    2020-12-18 02:17

    When you click one item you could loop through the rest and collapse each one except for the one you just clicked...

    list.setOnGroupExpandListener(new OnGroupExpandListener() {
    
        public void onGroupExpand(int groupPosition) {
            int len = mAdapter.getGroupCount();
    
            for(int i=0; i

提交回复
热议问题