Hide footer view in ListView?

前端 未结 13 2124
既然无缘
既然无缘 2020-12-02 06:49

I have a ListView. The data behind it is fetched from the Internet, in sets of 10-30 items whenever the user scrolls all the way to the bottom. In order to indi

13条回答
  •  爱一瞬间的悲伤
    2020-12-02 06:49

    first I am adding my footer to the listview,like this

    listView.addFooterView(Utils.b);
    

    Then on button click , I remove the view,

    listView.removeFooterView(Utils.b);
    

    I am adding the footer everytime when I am hitting the async,and theus the're no duplicate entry.I could aslo check for the count and so it like this,

    if(listView.getFooterViewsCount() > 0){//if footer is added already do something}
    

提交回复
热议问题