How to keep ExpandableListView in expanded status?

后端 未结 6 1631
北恋
北恋 2020-12-14 09:19

I use

SimpleExpandableListAdapter

in my

ExpandableListActivity

When user click th

6条回答
  •  被撕碎了的回忆
    2020-12-14 09:50

    For always expanded groups, I extend SimpleExpandableListAdapter and set the group to be expanded in the getGroupView method:

    @Override
    public View getGroupView(int groupPosition, boolean isExpanded, View convertView, ViewGroup parent) {
        View v = super.getGroupView(groupPosition, isExpanded, convertView, parent);
        ExpandableListView eLV = (ExpandableListView) parent;
        eLV.expandGroup(groupPosition);
        return v;
    }
    

提交回复
热议问题