iOS:fix refreshable cannot scroll properly
This commit is contained in:
parent
c1ac0a04a5
commit
783f77e7ac
@ -96,7 +96,17 @@ - (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL
|
|||||||
|
|
||||||
- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
|
- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
|
||||||
if (scrollView.contentOffset.y <= 0) {
|
if (scrollView.contentOffset.y <= 0) {
|
||||||
[self.swipePullingDelegate setPullingDistance:-scrollView.contentOffset.y];
|
if ([self.contentView isKindOfClass:UIScrollView.class]
|
||||||
|
&& ((UIScrollView *) self.contentView).contentOffset.y > 0) {
|
||||||
|
scrollView.contentOffset = (CGPoint) {0, 0};
|
||||||
|
} else {
|
||||||
|
[self.swipePullingDelegate setPullingDistance:-scrollView.contentOffset.y];
|
||||||
|
}
|
||||||
|
} 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};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user