I looked for solution on Stack Overflow but I didn't find one. My code is:
CGRect rect = _postContentView.bounds;
_postContentUIWV = [[UIWebView alloc] initWithFrame:rect];
[_postContentUIWV loadHTMLString:selectedPostCD.content baseURL:nil];
int fontSize = 30;
NSString *jsString = [[NSString alloc] initWithFormat:
@"document.getElementsByTagName('span')[0].style.webkitTextSizeAdjust='%d%%'",
fontSize];
[_postContentUIWV stringByEvaluatingJavaScriptFromString:jsString];
[_postContentView addSubview:_postContentUIWV];
And the part of HTML inside UIWebView
:
<p style="text-align: justify;">
<span style="line-height: 1.5em;">blablablablablabla</span>
</p>
My code doesn't increase the font size inside UIWebView
. How can I solve it?