[英]How to make a child node clickable in ExpandableListView in Android
[英]How to make an ExpandableListView in Android always show child items
我想制作一个ExpandableListView
,即使单击标题后也应该始终显示其子元素,并且它不应该折叠。 我如何实施这个概念?
您可以按照这篇文章中的说明,按如下所示逐个展开所有组
ExpandableListView explst;
explst.expandGroup(0);
explst.expandGroup(1);
禁用崩溃,你可以定义一个OnGroupClickListener返回true,像这样:(因为在提到这个岗位)
explst.setOnGroupClickListener(new OnGroupClickListener() {
@Override
public boolean onGroupClick(ExpandableListView parent, View v,
int groupPosition, long id) {
return true; // This way the expander cannot be collapsed
}
});
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.