Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to increase font size in UIWebView

how to increase or decrease the UIWebview font size, not using scalePageToFit:NO;

like image 922
Bala Avatar asked Feb 26 '09 05:02

Bala


1 Answers

I have 2 buttons - A- and A+

@interface NSUInteger textFontSize;  - (IBAction)changeTextFontSize:(id)sender {     switch ([sender tag]) {         case 1: // A-             textFontSize = (textFontSize > 50) ? textFontSize -5 : textFontSize;             break;         case 2: // A+             textFontSize = (textFontSize < 160) ? textFontSize +5 : textFontSize;             break;     }      NSString *jsString = [[NSString alloc] initWithFormat:@"document.getElementsByTagName('body')[0].style.webkitTextSizeAdjust= '%d%%'",                            textFontSize];     [web stringByEvaluatingJavaScriptFromString:jsString];     [jsString release]; } 
like image 92
Taras Kalapun Avatar answered Sep 23 '22 08:09

Taras Kalapun