UIWebView 禁止长按复制粘贴

2017-03-02  本文已影响0人  狗娃_

直接上代码:

- (void)webViewDidFinishLoad:(UIWebView *)webView {
    // Disable user selection
    [webView stringByEvaluatingJavaScriptFromString:@"document.documentElement.style.webkitUserSelect='none';"];
    // Disable callout
    [webView stringByEvaluatingJavaScriptFromString:@"document.documentElement.style.webkitTouchCallout='none';"];
}
上一篇 下一篇

猜你喜欢

热点阅读