美文网首页iOS 开发中遇到的问题
关于MJRerefresh MJRefreshStateNoMo

关于MJRerefresh MJRefreshStateNoMo

作者: 韧风透骨寒 | 来源:发表于2018-11-27 20:46 被阅读32次

    修改的位置 MJRefreshBackNormalFooter.m 类中

    - (void)setState:(MJRefreshState)state{
        MJRefreshCheckState
    
        // 根据状态做事情
    
        if (state == MJRefreshStateIdle) {
    
            if(oldState ==MJRefreshStateRefreshing) {
    
                self.arrowView.transform = CGAffineTransformMakeRotation(0.000001 - M_PI);
    
                [UIView animateWithDuration:MJRefreshSlowAnimationDuration animations:^{
    
                    self.loadingView.alpha=0.0;
    
                }completion:^(BOOLfinished) {
                    self.loadingView.alpha=1.0;
                    [self.loadingViewstopAnimating];
    
                    //添加这一句
                
                    if(self.state != MJRefreshStateNoMoreData ||self.state == MJRefreshStateRefreshing)
    
                    self.arrowView.hidden=NO;
                }];
    
            }else{
    
                self.arrowView.hidden=NO;
    
                [self.loadingViewstopAnimating];
    
                [UIView animateWithDuration:MJRefreshFastAnimationDuration animations:^{
    
                    self.arrowView.transform = CGAffineTransformMakeRotation(0.000001 - M_PI);
    
                }];
    
            }
    
        }else if (state == MJRefreshStatePulling) {
    
            self.arrowView.hidden=NO;
    
            [self.loadingView stopAnimating];
    
            [UIView animateWithDuration:MJRefreshFastAnimationDuration animations:^{
    
                self.arrowView.transform = CGAffineTransformIdentity;
    
            }];
    
        }else if (state == MJRefreshStateRefreshing) {
    
            self.arrowView.hidden=YES;
    
            [self.loadingView startAnimating];
    
        }else if (state == MJRefreshStateNoMoreData) {
    
            self.arrowView.hidden=YES;
    
            [self.loadingView stopAnimating];
    
        }
    
    

    相关文章

      网友评论

        本文标题:关于MJRerefresh MJRefreshStateNoMo

        本文链接:https://www.haomeiwen.com/subject/plinqqtx.html