Android customized listview layout to realize pull-up loading pull-down refresh function

Listview implements pull-up loading and pull-down refresh in many ways. The following is a custom layout I wrote, which is also highly reusable. The first is the inherited listview custom view.

AutoListView.Java:

The above code is the key to the implementation. The following is the head layout and foot layout:

foot_ view.xml:

pull_ to_ refresh_ header.xml:

activity_ main.xml:

The above steps are to load different layouts up and down the listview. The above code is also the code to be reused. The following code is how to use it

MainActivity.java:

The following is the implementation, which is to set monitoring where you need it, and the operations required to load and refresh it!

The above is the Android custom listview layout introduced by Xiaobian. It realizes the pull-up load pull-down refresh function. I hope it will be helpful to you. If you have any questions, please leave me a message and Xiaobian will reply to you in time. Thank you very much for your support for the programming tips website!

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>