[webView stringByEvaluatingJavaScriptFromString:@"document.documentElement.style.webkitUserSelect='none';"]; [webView stringByEvaluatingJavaScriptFromString:@"document.documentElement.style.webkitTouchCallout='none';"];作者:levinYuXiao 链接:http://www.jianshu.com/p/65e773ab02f8 來源:简书 著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。
-(void)webViewDidFinishLoad:(UIWebView *)webView{
//字体大小
[webView stringByEvaluatingJavaScriptFromString:@"document.getElementsByTagName('body')[0].style.webkitTextSizeAdjust= '100%'"];
//字体颜色
[webView stringByEvaluatingJavaScriptFromString:@"document.getElementsByTagName('body')[0].style.webkitTextFillColor= 'black'"];
//页面背景色
[webView stringByEvaluatingJavaScriptFromString:@"document.getElementsByTagName('body')[0].style.background='#EFEFF4'"];
self.webView.backgroundColor = [UIColor colorFromHexRGB:bgColorStr]
// - 禁止长按手势
[webView stringByEvaluatingJavaScriptFromString:@"document.documentElement.style.webkitUserSelect='none';"];
[webView stringByEvaluatingJavaScriptFromString:@"document.documentElement.style.webkitTouchCallout='none';"];
[webView stringByEvaluatingJavaScriptFromString:@"document.documentElement.style.webkitUserSelect='none';"]; [webView stringByEvaluatingJavaScriptFromString:@"document.documentElement.style.webkitTouchCallout='none';"];作者:levinYuXiao 链接:http://www.jianshu.com/p/65e773ab02f8 來源:简书 著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。
[webView stringByEvaluatingJavaScriptFromString:@"document.documentElement.style.webkitUserSelect='none';"]; [webView stringByEvaluatingJavaScriptFromString:@"document.documentElement.style.webkitTouchCallout='none';"];作者:levinYuXiao 链接:http://www.jianshu.com/p/65e773ab02f8 來源:简书 著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。}[webView stringByEvaluatingJavaScriptFromString:@"document.documentElement.style.webkitUserSelect='none';"]; [webView stringByEvaluatingJavaScriptFromString:@"document.documentElement.style.webkitTouchCallout='none';"];作者:levinYuXiao 链接:http://www.jianshu.com/p/65e773ab02f8 來源:简书 著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。[webView stringByEvaluatingJavaScriptFromString:@"document.documentElement.style.webkitUserSelect='none';"]; [webView stringByEvaluatingJavaScriptFromString:@"document.documentElement.style.webkitTouchCallout='none';"];作者:levinYuXiao 链接:http://www.jianshu.com/p/65e773ab02f8 來源:简书 著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。[webView stringByEvaluatingJavaScriptFromString:@"document.documentElement.style.webkitUserSelect='none';"]; [webView stringByEvaluatingJavaScriptFromString:@"document.documentElement.style.webkitTouchCallout='none';"];作者:levinYuXiao 链接:http://www.jianshu.com/p/65e773ab02f8 來源:简书 著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。[webView stringByEvaluatingJavaScriptFromString:@"document.documentElement.style.webkitUserSelect='none';"]; [webView stringByEvaluatingJavaScriptFromString:@"document.documentElement.style.webkitTouchCallout='none';"];作者:levinYuXiao 链接:http://www.jianshu.com/p/65e773ab02f8 來源:简书 著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。[webView stringByEvaluatingJavaScriptFromString:@"document.documentElement.style.webkitUserSelect='none';"]; [webView stringByEvaluatingJavaScriptFromString:@"document.documentElement.style.webkitTouchCallout='none';"];作者:levinYuXiao 链接:http://www.jianshu.com/p/65e773ab02f8 來源:简书 著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。
/** 清除webView的缓存 */
[[NSURLCache sharedURLCache] removeAllCachedResponses];
[webView stringByEvaluatingJavaScriptFromString:@"document.documentElement.style.webkitUserSelect='none';"]; [webView stringByEvaluatingJavaScriptFromString:@"document.documentElement.style.webkitTouchCallout='none';"];作者:levinYuXiao 链接:http://www.jianshu.com/p/65e773ab02f8 來源:简书 著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处
UIWebView 修改背景色 和 禁止复制 清除 webview 的缓存
最新推荐文章于 2020-12-23 04:57:51 发布