如何保持ExpandableListView开的呢?ExpandableListView

2023-09-05 00:19:15 作者:你若离去巴掌扇去

我的工作我已经完成的工作,现在只有一个,我想要做的事情是我不希望的ListView是下拉上点击扩展列表视图的,而我想告诉它打开了ExpandableListView所有的项目里面没有显示对他们进行任何点击。

I am working on the ExpandableListView I have completed the work, now only one thing that I want to do is I don't want the ListView to be DropDown on click of the Expandable List View rather I want to show it opened with all the Items displayed inside without performing any click on them.

谁能告诉我,我怎么能做到这一点特别。

Can anyone tell me how can i do that particularly.

推荐答案

做到这一点,每一个群体来展开:

Do this for every one of the groups to expand them:

listView1.expandGroup(int groupPosition);

如果你想prevent组崩溃,那么做到这一点:

If you want to prevent group collapse, then do this:

listView1.setOnGroupClickListener(new ExpandableListView.OnGroupClickListener()
{
    public boolean onGroupClick(ExpandableListView arg0, View itemView, int itemPosition, long itemId)
    {
        listView1.expandGroup(itemPosition);
        return true;
    }
});