How to disable Copy and Paste in UIWebView

前端 未结 6 911
再見小時候
再見小時候 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:08

    - (void)webViewDidFinishLoad:(UIWebView *)webView {
     [iWebView stringByEvaluatingJavaScriptFromString:@"document.body.style.webkitTouchCallout='none';  document.body.style.KhtmlUserSelect='none'"];
    }
    

提交回复
热议问题