0
我想從改變擴展列表視圖 的默認行爲:擴展列表視圖更改默認行爲
short click => expand/collapse
到:
long click => expand/collapse
short click => select item or child
我想從改變擴展列表視圖 的默認行爲:擴展列表視圖更改默認行爲
short click => expand/collapse
到:
long click => expand/collapse
short click => select item or child
OK,這似乎是最好的解決辦法是用列表項點擊/長按聽衆來做到這一點。
public void onClick(View view)
{
// click - do something with item
}
public boolean onLongClick(View view)
{
// group position was stored in view tag
int groupPosition = (Integer) view.getTag();
ExpandableListView listView = (ExpandableListView) findViewById(R.id.expandableListView);
if (listView.isGroupExpanded(groupPosition))
listView.collapseGroup(groupPosition);
else
listView.expandGroup(groupPosition);
return true;
}
是這些setOnItemClickListeners ???? – Maxrunner
我想(如果我沒記錯的話),這些是添加到列表中的項目上的點擊偵聽器(每個都有一個鏈接回組的標籤) – Drejc