iOS设置WebView中的字体及型号

  • (void)webViewDidFinishLoad:(UIWebView *)webView { // 设置字体 NSString *fontFamilyStr = @"document.getElementsByTagName('body')[0].style.fontFamily='PingFangSC-Light';"; [webView stringByEvaluatingJavaScriptFromString:fontFamilyStr]; // 设置字体大小 NSString *fontSizeStr = @"document.getElementsByTagName('section')[0].style.fontSize='14px';"; [webView stringByEvaluatingJavaScriptFromString:fontSizeStr]; }

你可能感兴趣的:(iOS设置WebView中的字体及型号)