html – Turn off magnifying glass webview ios swift


Please tell me how can I disable the magnifying glass in webview ios swift that appears when I press it twice and hold it?

User-select is set to none on all elements.

Below is the screenshot, html code and ios swift code.

Has anyone encountered this? Is there a solution?

enter image description here

<html>
<head>
    <meta name="viewport" content="viewport-fit=cover, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no, width=device-width"> 
    <meta name="apple-mobile-web-app-capable" content="yes">
</head>
<style>
* {
    -webkit-user-drag: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0) !important;
    user-select: none;
}
body {
    background: green;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}
</style>
<body>
    TEST
</body>
</html>
import UIKit
import WebKit

class ViewController: UIViewController, WKUIDelegate, WKNavigationDelegate {

    var webView: WKWebView!

    override func viewDidLoad() {
        super.viewDidLoad()

        let webConfiguration = WKWebViewConfiguration()
        webView = WKWebView(frame: .zero, configuration: webConfiguration)
        webView.uiDelegate = self
        webView.navigationDelegate = self

        if let myURL = URL(string: "*") {
            let myRequest = URLRequest(url: myURL)
            webView.load(myRequest)
        }
    }

    func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) {
        self.view = webView
    }
    override var prefersHomeIndicatorAutoHidden: Bool {
        return true
    }
}

Latest articles

spot_imgspot_img

Related articles

Leave a reply

Please enter your comment!
Please enter your name here

spot_imgspot_img