当滑动方向是从左到右时,我需要将滑动事件从uiwebview转发到它的超级视图(uiscrollview)。所以,我正试图像这样做什么
self.swipeGestureRecognizer = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(handleSwipe:)];
[self.webView addGestureRecognizer:self.swipeGestureRecognizer];
和处理程序
-(void) handleSwipe:(UISwipeGestureRecognizer*) swipeRecognizer {
if(swipeRecognizer.direction == UISwipeGestureRecognizerDirectionRight) {
//change to dispatching swipe to scrollview
CGPoint contentOffset = [self.scrollView contentOffset];
contentOffset.x -= 1024;
[self.scrollView setContentOffset:contentOffset animated:YES];
}}
相反,更改滚动视图偏移我不想向前滑动它。我怎么能这样做?