How we can disable the magnification glass in uiwebview in ios 9 ?
I use this code below to disable the selection/copy.. in uiwebview:
* {
-webkit-touch-callout: none;
-webkit-user-select: none; /* Disable selection/copy in UIWebView */
}
it works, but the problem is the new magnification glass in ios 9, so is there any solution to disable it?
Note: I don't use Cordova
I just tried the following hack & it worked for me. This will override the long press in the webView.
UILongPressGestureRecognizer *longPress = [[UILongPressGestureRecognizer alloc]initWithTarget:nil action:NULL];
longPress.minimumPressDuration = 0.2;
[webView addGestureRecognizer:longPress];
Swift
let longPress:UILongPressGestureRecognizer = UILongPressGestureRecognizer(target: nil, action: nil)
longPress.minimumPressDuration = 0.2
webView.addGestureRecognizer(longPress)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With