Android可扩展列表视图子焦点

时间:2013-04-26 06:19:28

标签: android focus expandablelistview

我在android中有一个可扩展的列表视图,其中组和子都作为文本视图,当我触摸父组时它显示不同的聚焦状态,但是孩子不显示这种行为。我认为重点是问题。任何建议。

2 个答案:

答案 0 :(得分:1)

  

如果您使用自定义展开式列表适配器:

@SuppressLint("UseSparseArrays")
public class MyExpandableListAdapter extends BaseExpandableListAdapter {

    /*
    ....
    */

    @Override
    public boolean isChildSelectable(int groupPosition, int childPosition) {

        return true; //this will be false by default. 
    }
}

答案 1 :(得分:0)

您必须在ExpandableListView

中添加选择器
android:listSelector="@drawable/button_hover"