Skip to content

Commit

Permalink
fix(ios): header and footer refresh bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
wwwcg committed Jul 4, 2024
1 parent 34e1f5a commit c96eeaa
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ - (void)refresh {
[UIView animateWithDuration:.2f animations:^{
CGPoint bottomOffset
= CGPointMake(0, self.scrollView.contentSize.height - self.scrollView.bounds.size.height + self.scrollView.contentInset.bottom);
[self.scrollView setContentOffset:bottomOffset animated:YES];
self.scrollView.contentOffset = bottomOffset;
} completion:^(BOOL finished) {
self.status = HippyRefreshStatusStartLoading;
}];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,14 @@ - (void)resetInset
}
}

- (void)refresh {
[UIView animateWithDuration:.2f animations:^{
self.scrollView.contentOffset = CGPointMake(0, -self.bounds.size.height);
} completion:^(BOOL finished) {
self.status = HippyRefreshStatusStartLoading;
}];
}

- (void)scrollViewDidEndDragging {
if (_scrollView && -_scrollView.contentOffset.y > CGRectGetHeight(self.bounds)) {
self.status = HippyRefreshStatusStartLoading;
Expand Down

0 comments on commit c96eeaa

Please sign in to comment.