Android Expandable list

后端 未结 3 1075
無奈伤痛
無奈伤痛 2020-12-30 08:08

I am trying to use a custom ExpandableListView with parent and child layout with a parent XML and child XML.

My data would be a server response. So I pr

3条回答
  •  遥遥无期
    2020-12-30 08:32

    you can change the indicator by calling setGroupIndicator

    Expandable lists are able to show an indicator beside each item to display the item's current state (the states are usually one of expanded group, collapsed group, child, or last child). Use setChildIndicator(Drawable) or setGroupIndicator(Drawable) (or the corresponding XML attributes) to set these indicators (see the docs for each method to see additional state that each Drawable can have).

    also, you need your own implementation of an ExpandableListAdapter. it's possible to inflate your own views for both parents and children in it.

提交回复
热议问题