Under iOS development pull refresh and pull up load more

Source: Internet
Author: User

Under iOS development pull refresh and pull up load more

1. Introduction

Common implementation of pull-down refreshes

(1) Uirefreshcontrol

(2) Egotableviewrefresh

(3) Ah3dpullrefresh

(4) Mjrefresh

(5) Self-realization

Use of 2.uiscrollview+pullload2.1

Drop-down refresh:

Pull-up loads more:

2.2 Implementation

First step, first add UISCROLLVIEW+PULLLOAD.M to project, set UISCROLLVIEW+PULLLOAD.M file to non arc (join-FNO-OBJC-ARC)

Add a header file to a. m file that needs to add a drop-down refresh

#import "Uiscrollview+pullload.h"

The second step is to add drop-down refreshes and pull-up loads for the table view more

 -(void  )    pulldownloadend {_count  = 1  ;    _tableview.canpullup  = YES;    [Self startdownloaddata];    [_tableview Reloaddata]; [_tableview stoploadwithstate:pulldownloadstate];}  -(void  ) pulluploadend {_count  + = 1  ;  if  (_count > 10   = NO;    } [self startdownloaddata];    [_tableview Reloaddata]; [_tableview stoploadwithstate:pulluploadstate];} 



* Caveats:
    if (Self.interceptor.downView) //         [Self.interceptor.downView setframe:cgrectmake (0, Self.contentSize.height, Self.frame.size.width,)];        [Self.interceptor.downView Setframe:cgrectmake (0300  )];

When implementing a pull-down load with this class, the view shown by default is the entire Self.view, which is:
[Self.interceptor.downView setframe:cgrectmake (0, Self.contentSize.height, Self.frame.size.width, 300)];
Need to read:
[Self.interceptor.downView setframe:cgrectmake (0, self.contentsize.height-140-64-49, Self.frame.size.width, 300-14 0-64-49)];

for the current program.



Under iOS development pull refresh and pull up load more

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.