首页 > 其他 > 详细

SVPullToRefresh问题解决

时间:2015-05-16 16:18:57      阅读:2437      评论:1      收藏:1      [点我收藏+]

 今天在使用SVPullToRefresh时发现当数据太少时,刷新的时候同时进行了上拉和下拉刷新,现解决方法如下:

  解决办法:

   1、打开iUIScrollView+SVInfiniteScrolling.m

         2、然后找到第194行,

       

    - (void)scrollViewDidScroll:(CGPoint)contentOffset {

    if(self.state != SVInfiniteScrollingStateLoading && self.enabled) {

        CGFloat scrollViewContentHeight = self.scrollView.contentSize.height;

        CGFloat scrollOffsetThreshold = scrollViewContentHeight-self.scrollView.bounds.size.height;

        

        if(!self.scrollView.isDragging && self.state == SVInfiniteScrollingStateTriggered)

        {     

            if (self.scrollView.contentOffset.y>0) {   //把这个判断加上去即可。

                   self.state = SVInfiniteScrollingStateLoading;

            }

        }

        

        else if(contentOffset.y > scrollOffsetThreshold && self.state == SVInfiniteScrollingStateStopped && self.scrollView.isDragging)

            self.state = SVInfiniteScrollingStateTriggered;

        else if(contentOffset.y < scrollOffsetThreshold  && self.state != SVInfiniteScrollingStateStopped)

            self.state = SVInfiniteScrollingStateStopped;

    }

}

 

SVPullToRefresh问题解决

原文:http://www.cnblogs.com/zhanggui/p/4507923.html

(2)
(3)
   
举报
评论 一句话评论(1
2015-08-25 20:18:21
完美解决   同时也有一个bug  上拉的方法没法调用  请大神帮忙  329347468@qq.com
回复
 (8)
 (2)
1条  
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!