标签:uiwebview
比较简单的做法是:在- (void)webViewDidFinishLoad:这个方法中,修改JavaScript的值:
//UIWebViewDelegate - (void)webViewDidFinishLoad:(UIWebView *)webView { /* code */ //修改页面的meta的值 if (SVPWebViewTypeActivity_Narrow == self.webViewType){ NSString *meta = [NSString stringWithFormat:@"document.getElementsByName(\"viewport\")[0].content = \"width=%f, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no\"", webView.frame.size.width]; [webView stringByEvaluatingJavaScriptFromString:meta]; } }
版权声明:本文为博主原创文章,未经博主允许不得转载。
标签:uiwebview
原文地址:http://blog.csdn.net/hherima/article/details/47448755