如何禁用ExpandableListView的塌陷?ExpandableListView

由网友(哇塞!有帥哥)分享简介:我想实现一个 ExpandableListView 这应该是扩展后,才所有的值被设置在适配器内。此外,我希望能够禁用扩展的溃散。 I would like to implement a ExpandableListView which should be expandable only after all the v...

我想实现一个 ExpandableListView 这应该是扩展后,才所有的值被设置在适配器内。此外,我希望能够禁用扩展的溃散。

I would like to implement a ExpandableListView which should be expandable only after all the values have been set up within the adapter. Also I would like to be able to disable the collapsing of the expander.

我能做到这一点在Android XML布局中?

Can I achieve this within an Android XML Layout?

问候, 一个Jabeer阿里

Regards, A Jabeer Ali

推荐答案

您可以定义一个 OnGroupClickListener 返回,像这样:

You can define a OnGroupClickListener which returns true, like so:

expandableList.setOnGroupClickListener(new OnGroupClickListener() {
  @Override
  public boolean onGroupClick(ExpandableListView parent, View v,
                              int groupPosition, long id) { 
    return true; // This way the expander cannot be collapsed
  }
});
阅读全文

相关推荐

最新文章