Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions Class/CBStoreHouseRefreshControl.m
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ + (CBStoreHouseRefreshControl*)attachToScrollView:(UIScrollView *)scrollView
if (startPoint.y > height) height = startPoint.y;
if (endPoint.y > height) height = endPoint.y;
}
height += lineWidth*0.5;
refreshControl.frame = CGRectMake(0, 0, width, height);

// Create bar items
Expand Down Expand Up @@ -136,7 +137,7 @@ + (CBStoreHouseRefreshControl*)attachToScrollView:(UIScrollView *)scrollView

- (void)scrollViewDidScroll
{
if (self.originalTopContentInset == 0) self.originalTopContentInset = self.scrollView.contentInset.top;
if (self.originalTopContentInset == 0 && self.state != CBStoreHouseRefreshControlStateRefreshing) self.originalTopContentInset = self.scrollView.contentInset.top;
self.center = CGPointMake([UIScreen mainScreen].bounds.size.width/2, self.realContentOffsetY*krelativeHeightFactor);
if (self.state == CBStoreHouseRefreshControlStateIdle)
[self updateBarItemsWithProgress:self.animationProgress];
Expand Down Expand Up @@ -176,7 +177,7 @@ - (void)scrollViewDidEndDragging

- (CGFloat)animationProgress
{
return MIN(1.f, MAX(0, fabsf(self.realContentOffsetY)/self.dropHeight));
return MIN(1.f, MAX(0, fabs(self.realContentOffsetY)/self.dropHeight));
}

- (CGFloat)realContentOffsetY
Expand Down