Joan Cardona
Joan Cardona

Reputation: 3691

Disable zoom in a UIWebView but keep other user interaction

I have a UIWebView that shows some text, I want to disable zoom/unzoom but I want to detect when users tap on a link. I have tried with disabling MultiTouch but zoom is still working.

Upvotes: 1

Views: 2855

Answers (2)

Sridhara Shetty
Sridhara Shetty

Reputation: 107

Try this

- (UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView 
{
  return nil;
}

Upvotes: 0

Tyler Cloutier
Tyler Cloutier

Reputation: 2050

Setting the minimumZoomScale and maximumZoomScale on your webview's UIScrollView to be 1.0 should prevent the webview from zooming.

webview.scrollView.maximumZoomScale = 1.0;
webview.scrollView.minimumZoomScale = 1.0;

Upvotes: 4

Related Questions