iOS pull-down refresh-Mjrefresh

Source: Internet
Author: User

Open source Third party address: Https://github.com/CoderMJLee/MJRefresh

Default Pull-down example

Call the method separately. You can also use block.

Mjrefreshnormalheader *header = [Mjrefreshnormalheader headerwithrefreshingtarget:self refreshingAction: @selector ( Headrefresh)];

Mjrefreshautonormalfooter *footer = [Mjrefreshautonormalfooter footerwithrefreshingtarget:self refreshingAction:@ Selector (Footrefresh)];

Self.tabeleView.mj_header = header;

Self.tabeleView.mj_footer = footer;

[Self.tabeleView.mj_header beginrefreshing];

A kind of pull-down and two planting

-1.1 General Chrysanthemum drop Mjrefreshnormalheader

-1.2 Add animation drop-down Mjrefreshgifheader

-2.1-click or Auto-load daisy pull-up Mjrefreshautonormalfooter

-2.2-click or auto-load animation pull-up Mjrefreshautogiffooter

-3.1 Reverse Daisy pull-up Mjrefreshbacknormalfooter

-3.2 Reverse animation on pull Mjrefreshbackgiffooter

Basic properties and methods

/** Enter Refresh Status */

-(void) beginrefreshing;

/** End Refresh Status */

-(void) endrefreshing;

/** is refreshing */

-(BOOL) isrefreshing;

/** automatically toggles transparency according to the drag ratio */

@property (Assign, nonatomic, Getter=isautomaticallychangealpha) BOOL Automaticallychangealpha;

Prompt text and time

All headers can be set prompt text, drop-down can set the refresh time

General use of 3 states: Mjrefreshstateidle,mjrefreshstatepulling,mjrefreshstaterefreshing

Hint text provides a label customization, and there are ways to set the display content in different states

Header.stateLabel.hidden = YES;

[Header settitle:@] and then pull down a bit to refresh the "Forstate:mjrefreshstateidle";

[Header settitle:@ "release that is Refresh" forstate:mjrefreshstatepulling];

[Header settitle:@ "Loading ..." forstate:mjrefreshstaterefreshing];

Update time provides a label customization

Header.lastUpdatedTimeLabel.hidden = YES;

Loading animations

All GIF headers can be set in an array of images.

General use of 3 states: Mjrefreshstateidle,mjrefreshstatepulling,mjrefreshstaterefreshing

Set up an array of pictures in different states

[Gifheader setimages:arr1 forstate:mjrefreshstateidle];//a piece is enough.

[Gifheader setimages:arr2 forstate:mjrefreshstatepulling];

[Gifheader SETIMAGES:ARR3 forstate:mjrefreshstaterefreshing];

Other

Fully customizable See demo DIY,

iOS pull-down refresh-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.