iOS: fix when list is in Refreshable, it may not be able to respond to the sliding gesture in time when the list is swiped quickly.

This commit is contained in:
pengfei.zhou 2023-03-15 19:16:12 +08:00 committed by jingpeng
parent 978e33e8c5
commit b1c4ccd944

View File

@ -112,7 +112,12 @@ - (void)scrollViewDidScroll:(UIScrollView *)scrollView {
} else if (scrollView.contentOffset.y + scrollView.height > scrollView.contentSize.height) {
if ([self.contentView isKindOfClass:UIScrollView.class]
&& ((UIScrollView *) self.contentView).contentOffset.y + self.contentView.height < ((UIScrollView *) self.contentView).contentSize.height) {
scrollView.contentOffset = (CGPoint) {0, scrollView.contentSize.height - scrollView.height};
self.bounces = NO;
[UIView animateWithDuration:0.2f animations:^{
scrollView.contentOffset = (CGPoint) {0, scrollView.contentSize.height - scrollView.height};
} completion:^(BOOL finished) {
self.bounces = YES;
}];
}
}
}