IOS development pull-down refresh and pull-up loading more, ios Loading

Source: Internet
Author: User

IOS development pull-down refresh and pull-up loading more, ios Loading

Pull-down refresh and pull-up loading for iOS development

1. Introduction

Common implementation methods of pull-down refresh

(1) UIRefreshControl

(2) EGOTableViewRefresh

(3) AH3DPullRefresh

(4) MJRefresh

(5) self-implementation

2. Use UIScrollView + PullLoad 2.1

Pull-down Refresh:

 

 

 

Pull up to load more:

 

 

 

2.2 Implementation

Step 1: Add UIScrollView + PullLoad. m to the project and set UIScrollView + PullLoad. m to a non-ARC (add-fno-objc-arc)

Add the header file to the. m file to be refreshed from the drop-down list.

# Import "UIScrollView + PullLoad. h"

 

Step 2: Add drop-down refresh and pull up more for the table View

-(Void) PullDownLoadEnd {_ count = 1; _ tableView. canPullUp = YES; [self startDownloadData]; [_ tableView reloadData]; [_ tableView stopLoadWithState: PullDownLoadState];}-(void) PullUpLoadEnd {_ count + = 1; if (_ count> 10) {_ tableView. canPullUp = NO;} [self startDownloadData]; [_ tableView reloadData]; [_ tableView stopLoadWithState: PullUpLoadState];}



* Note:
    if(self.interceptor.downView)//        [self.interceptor.downView setFrame:CGRectMake(0, self.contentSize.height, self.frame.size.width, 300)];        [self.interceptor.downView setFrame:CGRectMake(0, self.contentSize.height - 140 - 64 - 49, self.frame.size.width, 300 - 140 - 64 - 49)];
 

 

When this class is used for drop-down loading, the view displayed by default is the entire self. view, that is:
 [self.interceptor.downView setFrame:CGRectMake(0, self.contentSize.height, self.frame.size.width, 300)];
Change:
[self.interceptor.downView setFrame:CGRectMake(0, self.contentSize.height - 140 - 64 - 49, self.frame.size.width, 300 - 140 - 64 - 49)];

Is suitable for the current program.

 
 


 

Related Article

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.