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