我有一个可扩展 ListView ,其中所有列表都已展开。我不希望用户能够选择任何父项(组项)。我已经做到了,单击它不会折叠列表,但无法弄清楚如何使该项目不可选择。
最佳答案
使用 isChildSelectable 方法使您所需的子项可点击。在子模型对象中维护 isChildSelectable boolean 状态。
@Override
public boolean isChildSelectable(int groupPosition, int childPosition) {
return yourmodel.isChildSelectable;
}
关于java - 如何使 ExpandableListView 不可选?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22336895/