I had the same problem, this workaround worked for me:
-(void)webViewDidFinishLoad:(UIWebView *)webView{ [webView scalesPageToFit]; float scale = 130000/webView.scrollView.frame.size.width; NSString *jsString = [[NSString alloc] initWithFormat:@"document.getElementsByTagName('body')[0].style.webkitTextSizeAdjust= '%f%%'", scale]; [webView stringByEvaluatingJavaScriptFromString:jsString]; }
I have several UIWebView with different widths. I want to enable scaling, so the scalePageToFit function is enabled, which results in tiny text for smaller UIWebviews and a larger font for larger UIWebviews. To standardize the font size, calculate the scale by dividing a certain factor (you have to adjust it yourself, 130,000 worked for me with a font size of 10pt CSS) according to the width of the webview.
As far as I can tell, it is not related to zoomFactor, which is always 1.0. I did not check if the fonts are exactly the same size (visually) in UIWebViews, but are good enough that I could not tell.
source share