写了一个自定义的expandablelistview
group设置监听事件,能被点击
child setOnChildClickListener()无反应 什么原因???
下面是适配器中getchildView()的函数
试了一下 把return换成title(title是自定义布局中的一个textview) 可以进行点击
怎么回事????
public View getChildView(int groupPosition, int childPosition,
boolean isLastChild, View convertView, ViewGroup parent) {
View view = convertView;
if (view == null) {
//LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
LayoutInflater inflater = LayoutInflater.from(getActivity());
view = inflater.inflate(R.layout.childitem, null);
}
final TextView title = (TextView) view
.findViewById(R.id.child_text);
title.setText(childData.get(groupPosition).get(childPosition)
.get("child_text1").toString());
final TextView title2 = (TextView) view
.findViewById(R.id.child_text2);
title2.setText(childData.get(groupPosition).get(childPosition)
.get("child_text2").toString());
final TextView title3 = (TextView) view
.findViewById(R.id.child_text3);
title3.setText(childData.get(groupPosition).get(childPosition)
.get("child_text3").toString());
return view;
}
isChildSelectable()函数已设为true
public boolean isChildSelectable(int groupPosition, int childPosition) {
return true;
}