本文介绍了如何隐藏组ExpandableListView在安卓的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在ExpandableListView如果我只有一组。我想隐藏组,仅该集团的数据显示。请帮我

解决方案

我有同样的问题,这solveed我的问题

。在您的列表视图的适配器添加以下到getGroupView。

 如果(groupPosition == 0){
     convertView = layoutInflater.inflate(R.layout.blank_layout,NULL);

} 其他 {
    convertView = layoutInflater.inflate(R.layout.group_indicator_cell,NULL);
}
 

这将空白的第0 groupof名单。

在哪里留白的布局与内部具有layout_height = 0dp一些视图的布局。有用!

In ExpandableListView if I only have one group. I want to hide that group, only the group's data show that. Please help me

解决方案

I had the same problem and this solveed my issue.In your Listview's adapter add the following to the getGroupView.

if (groupPosition == 0) {
     convertView = layoutInflater.inflate(R.layout.blank_layout, null);

} else {
    convertView = layoutInflater.inflate(R.layout.group_indicator_cell,null);
}

This will blank the 0th groupof the list.

Where blank layout is a layout with some view inside having layout_height=0dp.It works!

这篇关于如何隐藏组ExpandableListView在安卓的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-17 15:24
查看更多