Android expandablelistview在展开组的时候不要滚动

解决方法:需要重新一下onGroupClick

具体代码:

mListView.setOnGroupClickListener(new ExpandableListView.OnGroupClickListener() {
            @Override
            public boolean onGroupClick(ExpandableListView parent, View v, int groupPosition, long id) {
                if(parent.isGroupExpanded(groupPosition)){
                    parent.collapseGroup(groupPosition);
                }else{
//第二个参数false表示展开时是否触发默认滚动动画
                    parent.expandGroup(groupPosition,false);
                }
                //telling the listView we have handled the group click, and don't want the default actions.
                return true;
            }
        });


你可能感兴趣的:(常用方法)