How to disable Copy and Paste in UIWebView

前端 未结 6 923
再見小時候
再見小時候 2020-12-09 13:17

When a user long-press inside UIWebView, there is a Copy & Paste popup. Is it possible to disable the system from popup the Copy & Paste function, but still allow th

6条回答
  •  臣服心动
    2020-12-09 14:07

    Try this

    [webView stringByEvaluatingJavaScriptFromString:@"document.body.style.webkitTouchCallout='none'; document.body.style.KhtmlUserSelect='none'"];
    

提交回复
热议问题