Implement pull-down refresh effects. All IOS versions can be used.

Source: Internet
Author: User

First, no picture, no truth

Use third-party class libraries for pull-down refresh results

Odrefreshcontrol

Example directory structure:

Resources resource folder

Thirdpartlib third-party class library folder

Direct core callCodeThere are only six sentences in total, which are easy to use.

Set the position of the pull-down refresh

V_animateindicator * V = [[v_animateindicator alloc] initwithframe: cgrectmake (0. F,0. F,20. F,20. F)]; odrefreshcontrol* Refreshcontrol =[[Odrefreshcontrol alloc] initinscrollview: Self. ptv_main activityindicatorview: V]; [refreshcontrol addtarget: Self action: @ selector (role :) forcontrolevents: uicontroleventvaluechanged];

Method called after the pull-down refresh

-( void ) dropviewdidbeginrefreshing :( odrefreshcontrol * ) refreshcontrol {  double  delayinseconds =  3.0  ; dispatch_time_t poptime  = dispatch_time (dispatch_time_now, delayinseconds *  nsec_per_sec); dispatch_after (poptime, dispatch_get_main_queue (),  ^ ( void  ) { ///   Start   [self refreshcell];  ///   end   [refreshcontrol endrefreshing];});}  

prj_pulldownrefresh.zip example code address: http://ishare.iask.sina.com.cn/f/34837888.html

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.