iOS:fix refreshableview srolling problem

This commit is contained in:
pengfei.zhou 2021-09-01 15:44:04 +08:00 committed by osborn
parent 3f7aac9951
commit 15172bb653

View File

@ -91,6 +91,13 @@ - (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL
dispatch_async(dispatch_get_main_queue(), ^{
self.refreshing = YES;
});
} else if (scrollView.contentOffset.y + scrollView.height > scrollView.contentSize.height) {
self.bounces = NO;
[UIView animateWithDuration:0.2f animations:^{
scrollView.contentOffset = (CGPoint) {0, scrollView.contentSize.height - scrollView.height};
} completion:^(BOOL finished) {
self.bounces = YES;
}];
}
}