Pull to Refreshlistview add Headerview

Source: Internet
Author: User

Using Listview.addheaderview (view), you can add a view view above the ListView so that the ListView and the view join together in an effect that looks like a whole

Typically used for pull-up refresh pull-down load listview

1, about the Addheaderview (view) method of multiple use

Corresponding to a ListView object such as: List

Each time the Addheaderview (view) method is used, a view is added above the list object

The order in which the view is added is arranged in the order in which they are added,

List.addheaderview (View1);

List.addheaderview (VIEW2);

The effect is:

View1
View2
List

View1 on top view2 at the bottom.

2, about the position of the item subkey after the ListView object uses the Addheaderview () method

List.addheaderview (View1);

List.addheaderview (VIEW2);

There are two view views above the list object,

When the first position of the list object is the View1 view, it is no longer the first item subkey in the list

For example, after adding view1,view2, the position of the list's first item subkey becomes 2.

View1
View2
List

position:0

Position:1

Position:2--list.size ()-2;

Pull to Refreshlistview add Headerview

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.