读书人

expandablelistview与此同时展开一个g

发布时间: 2012-08-28 12:37:01 作者: rapoo

expandablelistview同时展开一个group

ExAdapter adapter;

ExpandableListView exList;

?

。。。。。。。。。。。。。。

adapter=new ExAdapter(DiseaseDetail.this);
??????? exList = (ExpandableListView) findViewById(R.id.list2);
??? ??? exList.setAdapter(adapter);
??? ??? exList.setGroupIndicator(null);
??? ??? exList.setDivider(null);
??? ??? exList.setOnGroupExpandListener(new OnGroupExpandListener(){

??? ??? ??? @Override
??? ??? ??? public void onGroupExpand(int arg0) {
??? ??? ??? ??????? // TODO Auto-generated method stub
??? ??? ??? ??????? for(int i=0;i<adapter.getGroupCount();i++)
??? ??? ??? ??????? {
??? ??? ??? ??????????????? if(arg0!=i)
??? ??? ??? ??????????????? {
??? ??? ??? ??????????????? ??? exList.collapseGroup(i);
??? ??? ??? ??????????????? }
??? ??? ??? ??????? }
??? ??? ??? ??????????????????????????????
??? ??? ??? }
??? ??? ??? ??????????????
??? ??? ??? ? });

读书人网 >移动开发

热点推荐