MJ Refresh control Mjrefreshfooterview back up after pull-up workaround

Source: Internet
Author: User

 Modify this method in the mjrefreshfooterview.m file

#pragmaMark-Status related#pragmaMark Set Status-(void) SetState: (mjrefreshstate) state{if(_state = = State)return; Mjrefreshstate oldstate=_state; [Super Setstate:state]; Switch(state) { Casemjrefreshstatepulling:{_statuslabel.text=Mjrefreshfooterreleasetorefresh; [UIView animatewithduration:mjrefreshanimationduration animations:^{_arrowimage.transform=cgaffinetransformidentity; Uiedgeinsets inset=_scrollview.contentinset; Inset.bottom=_scrollviewinitinset.bottom; _scrollview.contentinset=inset; }]; Break; } Casemjrefreshstatenormal:{_statuslabel.text=Mjrefreshfooterpulltorefresh; //just refreshed .CGFloat animduration =mjrefreshanimationduration; CGFloat Deltah=[self contentbreakview]; Cgpoint Tempoffset; intCurrentcount =[self totaldatacountinscrollview]; if(mjrefreshstaterefreshing = = Oldstate && Deltah >0&& Currentcount! =_lastrefreshcount) {Tempoffset=_scrollview.contentoffset; if (_appdelegate.isa) {//a view: Hide Footerview tempoffset.y-= 60; }else if (!_appdelegate.isa) {//b view: Show new data after pull-up tempoffset.y + =; } animduration=0; } [UIView animatewithduration:animduration animations:^{_arrowimage.transform=cgaffinetransformmakerotation (M_PI); Uiedgeinsets inset=_scrollview.contentinset; Inset.bottom=_scrollviewinitinset.bottom; _scrollview.contentinset=inset; }]; if(Animduration = =0) {_scrollview.contentoffset=Tempoffset; } Break; } Casemjrefreshstaterefreshing:{//number of records before the refresh_lastrefreshcount =[self totaldatacountinscrollview]; _statuslabel.text=mjrefreshfooterrefreshing; _arrowimage.transform=cgaffinetransformmakerotation (M_PI); [UIView animatewithduration:mjrefreshanimationduration animations:^{uiedgeinsets inset=_scrollview.contentinset; CGFloat Bottom= Mjrefreshviewheight +_scrollviewinitinset.bottom; CGFloat Deltah=[self contentbreakview]; if(Deltah <0) {//If the content height is less than the height of the viewBottom-=Deltah; } Inset.bottom=Bottom; _scrollview.contentinset=inset; }]; Break; } default: Break; }}

MJ Refresh control Mjrefreshfooterview back up after pull-up workaround

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.