Increasing the font size of a webview conflict with UIScrollView
i have a UIWebView inside a UIScrollView. I am using this code to increase
the font size of the 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]);
The font increase happens without any errors but only half of the text
inside the UIWebView is visible.
Monday, August 26, 2013
Increasing the font size of a webview conflict with UIScrollView
Posted on 9:10 AM by Unknown
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment