Pull-up refresh pull-down load

Source: Internet
Author: User
Two methods of pull refresh and drop refresh (including using third-party library Mjrefresh)
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 filename" 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;//was to be hidden from the beginning, and we just put it out when ScrollView dragged it to the bottom.
Self.tableView.tableFooterView = footer;//is actually 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

Pull-up refresh pull-down load

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.