Why does UIScrollView cancel my touches on the iPa

2019-08-31 22:56发布

问题:

I have an UIScrollView subclass where I implement all of those 4 touch event handling methods like -touchesBegan:withEvent:, etc.

On the iPhone, the tracking works fine. I get plenty of -touchesMoved:withEvent: calls while the finger moves along the scroll view.

I've set the self.canCancelContentTouches = NO;. I've also overwritten this:

- (BOOL)touchesShouldCancelInContentView:(UIView *)view {
    return NO;
}

After dragging about 5 points or so, it already cancels the touches. Always. I have nothing else than this UIScrollView in my view hierarchy. I can start dragging anywhere I want. After about 5 points touches get cancelled. Always. Anywhere.

And the strange thing: Only happens on the iPad, but not on the iPhone or iPod touch. A bug in UIScrollView?

回答1:

What version of iOS is on the your phone?

The iPad is still back at 3.2.x, so there might be lots of things fixed already in subsequent phone releases that haven't made their way to the iPad yet...