How to add multiple header views in a ListView

后端 未结 3 737
时光说笑
时光说笑 2021-02-04 18:35

I\'ve a custom adapter for my ListView I want to add project names as the headers to my work requests. Adding a single header works just fine but I\'m not sure how

3条回答
  •  长情又很酷
    2021-02-04 19:25

    I would solve this issue with ExpandableListView. It doesn't require any extra library.

    • Create your custom adapter.
    • Give your data and fill the methods you need to override.
    • After setting the adapter with ExpandableListView:
      • Override groupItemClick so clicking on the groups won't actually expand the view.
      • Loop through every parent in adapter and set them expanded.

提交回复
热议问题