SVPullToRefresh问题解决

来源:互联网 发布:程序员高清图 编辑:程序博客网 时间:2024/06/05 15:16

今天在使用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;    }}
0 0
原创粉丝点击