简体   繁体   中英

Android Expandable List View Child Focus

I have an expandable List View in android with groups and child both as text views, When i touch parent group it is showing different focused states , BUT CHILD DOES NOT SHOW THIS BEHAVIOR. I think it is problem with focus. Any suggestions.

If you are using a Custom Expandable list Adapter:

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

    /*
    ....
    */

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

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

您必须在ExpandableListView中添加选择器

android:listSelector="@drawable/button_hover"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM