Manohar T
Manohar T

Reputation: 39

UIScrollView canCancelContentTouches not disabling scrolling

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.

Upvotes: 1

Views: 2437

Answers (2)

Jsdodgers
Jsdodgers

Reputation: 5302

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];

Upvotes: 2

Harini Vasanthakumar
Harini Vasanthakumar

Reputation: 39

set CanCancelContentTouches to YES

Upvotes: 0

Related Questions