Hide footer view in ListView?

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

    Works well in my project:

    1.Add footer view first

    mListView.addFooterView(mFooterView); mListView.setAdapter(mAdapter);

    2.Set visibility

    mFooterView.setVisibility(View.GONE); mFooterView.setPadding(0, 0, 0, 0);

    3.Set invisibility

    mFooterView.setVisibility(View.GONE); mFooterView.setPadding(0, -1*mFooterView.getHeight(), 0, 0);

提交回复
热议问题