Implementation method of pull-down refresh, pull-up loading and horizontal scrolling with columns in listview developed by Android

The listview control can display items in four different views. This control allows you to group items into columns with or without column headers and display accompanying icons and text.

You can use the listview control to organize list items called listitem objects into one of the following four different views: 1. Large (standard) icons 2. Small icons 3. List 4. The report view property determines which view the control uses to display items in the list.

You can also use the labelwrap property to control whether labels associated with items in the list can be wrapped. In addition, you can manage the sorting method of items in the list and the appearance of selected items.

I believe many people can use this for projects. It is the pull-down refresh and pull-up loading of listview and the horizontal scrolling of columns;

PS: horizontal scroll with header and fixed column (I believe many people have such a demand? It supports many columns on listview, but the device screen width is limited)

PS: This is an example demo that is a combination of two example demos I personally found on the Internet. It can be further expanded. It will be updated later when I have time. We can learn from each other

Listview pull-down refresh pull-up load example demo original source:

https://www.oudahe.com/p/16392/

Sample demo of horizontal scrolling (with header and fixed column) of listview original source:

https://www.oudahe.com/p/16409/

Next is the project list chart

java code

Layout file XML

design sketch:

The horizontally scrolled graph and the drop-down refresh can only be done because there is no dynamic graph

Pull down refresh

Refreshing

Pull up loading

Next is the code. Please look down

This is a custom override of the listview control autolistview.java

This is the override chscrollview.java of the custom horizontalscrollview

This is the adapter of listview, listviewscrolladapter.java

This is mainactivity.java

This is the layout file activity_ main.xml

auto_ listview_ Item.xml layout file item layout file of listview

The bottom of the listview prompts that the layout file listview is being loaded_ footer.xml

The top of the listview prompts the pull-down to refresh some status layout XML files pull_ to_ refresh_ header.xml

Android compilation and target version is 4.0.3

The above is the implementation method of pull-down refresh, pull-up loading and horizontal scrolling with columns in Android development listview introduced by Xiaobian. 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
分享
二维码
< <上一篇
下一篇>>