Two methods for pull-up and drop-down refreshes (including using third-party libraries Mjrefresh)

Source: Internet
Author: User

First, the use of Apple native method

1. Drop-down Refresh

2, Pull up refresh

(1 first to create a new footer Xib file, of course, including the corresponding controller files, such as in the Xib file can be dragged as follows the corresponding control

(2 Then write an instance method in the code file

+ (instancetype) footer

{

return [[[nsbundle mainbundle] loadnibnamed: @ "xib file name" Owner:nil Options:nil] Lastobject];

}

(3 is then called in our list controller:

/**

* Integrated pull-up refresh control

*/

-(void) refreshupstatedatelist

{

Xbloadmorefooter *footer = [xbloadmorefooter footer];

Footer.hidden = YES; //It was to be hidden at first, and we just put it out when ScrollView dragged it to the bottom.

self.tableView.tableFooterView = footer; //actually is equivalent to the Xib file as a tableview footer

}

(4 pull up to the bottom to call the method of refreshing more data

Second, the use of third-party library Mjrefresh

1. Drop-down Refresh

Abide by the agreement: <MJREFRESHBASEVIEWDELEGATE> and then actually use it as the header of the table view.

  

2. Drop-down Refresh

  

3, need to note: finally need dealloc

  

Two methods for pull-up and drop-down refreshes (including using third-party libraries Mjrefresh)

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.