1

UIScrollView我用一些图像创建了一个。然后我进行了触摸拖动UIImageView- 当我们触摸它时拖动到下一页。我曾经viewDidAppear滚动到结尾UIScrollView

- (void)viewDidAppear:(BOOL)animated {
    [super viewDidAppear:animated];
    self.scroll.contentSize = CGSizeMake(320, 1400);
}

但是当我过去Swipe Gesture Recognizer拖回UIScrollView时,我无法像开始运行应用程序时那样滚动到底部。我该如何解决?

4

1 回答 1

1

您必须明确告诉手势不要取消其内容视图的触摸。尝试这个:

[swipe setCancelsTouchesInView:NO];

如果这样做不行,请尝试使用 UIGestureRecognizerDelegate 方法shouldRecognizeSimultaneouslyWithGestureRecognizer

- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer
{
    return YES;
}
于 2012-12-21T03:59:31.467 回答