UIScrollView canCancelContentTouches does not disable scrolling

advertisements

I have subclassed UIScrollView. I am using zooming feature of scrollview.What I want is After zooming I don't want the view to be scrolled.So I do the following.

- (void)scrollViewDidEndZooming:(UIScrollView *)scrollView withView:(UIView *)view atScale:(float)scale
{
    [self setCanCancelContentTouches:NO];
}

But still it scrolls.


The canCancelContentTouches method does not disable scrolling, as you are expecting. Instead the way it works is whenever you hold your finger down on a button or other control that is a subview of the scrollview and then start making a scrolling gesture, it will cancel the touch on the control and begin scrolling instead.

What you are looking for is:

[self.scrollView setScrollEnabled:NO];