Remove header from listView

前端 未结 7 2154
执念已碎
执念已碎 2021-02-01 04:58

I\'m having some problems when trying to remove the header from a listView. At first I use addHeaderView() to add it, but when I change to another layo

7条回答
  •  自闭症患者
    2021-02-01 05:29

    If you are using addHeaderView(), you can't delete your header after that.

    So, don't use addHeaderView(). Rather, create your own adapter that blends your main roster of Views with your header. While my MergeAdapter will not handle your specific case, you can use it to see the concept of blending multiple row sources:

    https://github.com/commonsguy/cwac-merge

提交回复
热议问题