Hide footer view in ListView?

前端 未结 13 2108
既然无缘
既然无缘 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:57

    in my case addFooterView / removeFooterView() cause some artefacts. And I found other solution. I used FrameLayout as FooterView. And when I want to add Footer I called mFrameFooter.addView(myFooter); and mFrameFooter.removeAllViews(); for remove.

    FrameLayout frameLayout = new FrameLayout(this);
    listView.addFooterView(frameLayout);
    ......
    ......
    //For adding footerView
    frameLayout.removeAllViews();
    frameLayout.addView(mFooterView);
    //For hide FooterView
    frameLayout.removeAllViews();
    

提交回复
热议问题