Skip to content

Commit

Permalink
Merge pull request #118 from puyanlin/fix/pullRefreshTopSpacing
Browse files Browse the repository at this point in the history
Adding adjusted content top inset value when start pull-to-refresh animation
  • Loading branch information
kenobilyh authored May 10, 2023
2 parents 16ff42b + e16be18 commit b07a2f5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions AppDevPods/AppDevUIKit/UIScrollView+ADKPullToRefreshView.m
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,9 @@ - (void)startAnimating
self.state = ADKPullToRefreshStateLoading;

CGFloat contentOffsetTop = self.scrollView.pullToRefreshViewHeight + self.originalTopInset;
if (@available(iOS 11.0, *)) {
contentOffsetTop += self.scrollView.adjustedContentInset.top;
}
CGPoint scrollPoint = CGPointMake(self.scrollView.contentOffset.x, -contentOffsetTop);

[UIView animateWithDuration:0.3f
Expand Down

0 comments on commit b07a2f5

Please sign in to comment.