I am using the listview add/remove footer for listview cross app in android version 4.3?

前端 未结 2 422
渐次进展
渐次进展 2020-12-30 05:43

I used to the ListView add the footer view and also remove footer its worked fine in android version 4.4 above but problem in android version 4.3 and below I a

2条回答
  •  醉梦人生
    2020-12-30 06:38

    Yes. Headers/footers are indeed problematically with backward compatibility. I recently refactored code, to use relative layout instead of a footer, which did pretty much, what I expected on any device -> footer visible, footer gone. Try this with a ListView footer, this will not work, instead you need to call addFooterView, removeFooterView and even this is not working as mentioned. The crash could be circumvented by

    a = getAdapter()
    setAdapter(null)
    removeFooter()
    setAdapter(a)
    

    but the footer still was not working that way.

提交回复
热议问题