本文主要是介绍设置webView字体大小,宽度及缩放效果,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
-
- -(void)webViewDidFinishLoad:(UIWebView *)webView
- {
-
- [webView stringByEvaluatingJavaScriptFromString:@"document.getElementsByTagName('body')[0].style.webkitTextSizeAdjust= '40%'"];
- }
-
- -(void)webViewDidFinishLoad:(UIWebView *)webView
- {
-
- [webView stringByEvaluatingJavaScriptFromString:@"document.getElementsByTagName('body')[0].style.webkitTextSizeAdjust= '40%'"];
- }
-
- -(void)webViewDidFinishLoad:(UIWebView *)webView
- {
-
- NSString *meta = [NSString stringWithFormat:@"document.getElementsByName(\"viewport\")[0].content = \"width=self.view.frame.size.width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no\""];
- [webView stringByEvaluatingJavaScriptFromString:meta];
- }
-
- -(void)webViewDidFinishLoad:(UIWebView *)webView
- {
-
- NSString *meta = [NSString stringWithFormat:@"document.getElementsByName(\"viewport\")[0].content = \"width=self.view.frame.size.width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no\""];
- [webView stringByEvaluatingJavaScriptFromString:meta];
- }
这篇关于设置webView字体大小,宽度及缩放效果的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!