You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by GitBox <gi...@apache.org> on 2019/05/24 07:59:22 UTC
[GitHub] [incubator-weex] wbcyclist commented on a change in pull request #2109: [iOS] Fix scroller problems. https://github.com/apache/incubator-weex…
wbcyclist commented on a change in pull request #2109: [iOS] Fix scroller problems. https://github.com/apache/incubator-weex…
URL: https://github.com/apache/incubator-weex/pull/2109#discussion_r287253218
##########
File path: ios/sdk/WeexSDK/Sources/Component/WXScrollerComponent.mm
##########
@@ -749,12 +758,15 @@ - (void)scrollViewDidScroll:(UIScrollView *)scrollView
}
CGFloat scaleFactor = self.weexInstance.pixelScaleFactor;
- [_refreshComponent pullingdown:@{
- REFRESH_DISTANCE_Y: @(fabs((scrollView.contentOffset.y - _lastContentOffset.y)/scaleFactor)),
- REFRESH_VIEWHEIGHT: @(_refreshComponent.view.frame.size.height/scaleFactor),
- REFRESH_PULLINGDISTANCE: @(scrollView.contentOffset.y/scaleFactor),
- @"type":@"pullingdown"
- }];
+ if (_isDragging) {
+ // only trigger pullingDown event when user is dragging
+ [_refreshComponent pullingdown:@{
+ REFRESH_DISTANCE_Y: @(fabs((scrollView.contentOffset.y - _lastContentOffset.y)/scaleFactor)),
+ REFRESH_VIEWHEIGHT: @(_refreshComponent.view.frame.size.height/scaleFactor),
+ REFRESH_PULLINGDISTANCE: @(fabs(scrollView.contentOffset.y/scaleFactor)),
+ @"type":@"pullingdown"
Review comment:
fabs(scrollView.contentOffset.y/scaleFactor) 这里取绝对值是有问题的。
这样改动就不知道是滚到顶部往下拉的offset还是将顶部推上去后的offset。
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services