iOS:fix Refreshable

This commit is contained in:
pengfei.zhou
2020-04-08 15:20:38 +08:00
committed by osborn
parent b17ff48c59
commit 5babfb4c9c
3 changed files with 38 additions and 12 deletions

View File

@@ -77,6 +77,14 @@ - (void)setHeaderView:(UIView *)headerView {
self.refreshable = YES;
}
- (void)layoutSubviews {
[super layoutSubviews];
if (self.contentOffset.y != 0) {
return;
}
self.contentSize = self.frame.size;
}
- (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate {
if (-scrollView.contentOffset.y >= self.headerView.height) {
dispatch_async(dispatch_get_main_queue(), ^{