我在UIScrollView中有一个UIWebView。 我正在使用此代码来增加UIWebView的字体大小:
int fontSize = 150;
NSString *jsString = [[NSString alloc] initWithFormat:@"document.getElementsByTagName('body')[0].style.webkitTextSizeAdjust= '%d%%'", fontSize];
[LabelNewsContent stringByEvaluatingJavaScriptFromString:jsString];
NSString *size = [LabelNewContent stringByEvaluatingJavaScriptFromString:@"return Math.max( \
document.body.scrollHeight, document.documentElement.scrollHeight, \
document.body.offsetHeight, document.documentElement.offsetHeight, \
document.body.clientHeight, document.documentElement.clientHeight \
);"];
scrollview.contentSize = CGSizeMake(scrollview.contentSize.width, [size floatValue]);
字体增加没有任何错误,但UIWebView中只有一半文本可见。