ExpandableListView 子目錄點擊不響應,解決

/**
在每一個itemView中都包含其餘的組件,特別是button,button和listView的共存問題在這裏也是不可避免的須要解決,
方法比較簡單,即: 在item的佈局文件中的頂層Layout添加屬性: 
android:descendantFocusability="blocksDescendants" 
這個是設置該layout下面的子view沒法獲取focus,
我記得在測試的時候這設置就能夠了,
可是網上不少說法都是在button屬性裏也要設置以下屬性: 
android:focusable="false" 
**/
class ExpandableAdapter extends BaseExpandableListAdapter { .......... 
    @Override    
    public boolean isChildSelectable(int groupPosition, int childPosition)    {        
        return true; //這裏默認返回false,咱們須要改爲 true    
    } 
}
相關文章
相關標籤/搜索