Open Lpkiki opened 7 months ago
`// delegate of gesture to let scrollView can scroll or not
(BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer )gestureRecognizer { if([gestureRecognizer isKindOfClass:[UIPanGestureRecognizer class]]) { UIPanGestureRecognizer pan = (UIPanGestureRecognizer *)gestureRecognizer; CGPoint po = [pan velocityInView:pan.view];
if (po.y > 0 && _scrollView.contentOffset.y <= 0) {
//优化
if (_scrollView.contentSize.width > __gScreenWidth) {
NSLog(@"😭😭😭😭😭😭😭😭😭😭😭😭😭😭 ");
_scrollView.scrollEnabled = true;
return false;
}
//下面是 原逻辑
_scrollView.scrollEnabled = false;
return true;
}else {
_scrollView.scrollEnabled = true;
return false;
}
} return false; }`
解决了
一张图 高度小于屏幕高度的图 放大之后 ,左右滑动,很容易切换到下一张图上,有没有什么办法可以优化