設(shè)置字體大小
-(void)webViewDidFinishLoad:(UIWebView *)webView {
????[webView stringByEvaluatingJavaScriptFromString:@"document.getElementsByTagName('body')[0].style.webkitTextSizeAdjust= '40%'"];//修改百分比即可
}
設(shè)置webView內(nèi)容寬度等于屏幕寬度顯示,設(shè)置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];//(initial-scale是初始縮放比,minimum-scale=1.0最小縮放比,maximum-scale=5.0最大縮放比,user-scalable=yes是否支持縮放)
或者服務(wù)端修改:(未測(cè)試)