By clicking on the epub file page How to change the font size for the epub file for iphone application?

I am trying to parse an epub file in a UIWebView. I successfully understood. But I can not set the font size. So, when you need to increase the font on the epub file page. And I added a UISearchBar, but if I entered a text that it could not find. So please give me any suggestions, and if anyone has a code that people can provide me.
Thanks in Advance ....

+3
source share
2 answers

use this code, it will work.

-(void)addbtnClicked:(id)sender{

if([sender tag] == 1 && textFontSize < 160){
    //textFontSize = (textFontSize < 160) ? textFontSize +5 : textFontSize;
    textFontSize = textFontSize+5;


    NSLog(@"+ btn");}
else if(textFontSize > 10){
    NSLog(@"- btn");
   // textFontSize = (textFontSize > 50) ? textFontSize -5 : textFontSize;
    textFontSize = textFontSize-5;


}
NSString *jsString = [[NSString alloc] initWithFormat:@"document.getElementsByTagName('body')[0].style.webkitTextSizeAdjust= '%d%%'", 
                      textFontSize];
[webview stringByEvaluatingJavaScriptFromString:jsString];
[jsString release];


}
+3
source

NSUserDefaults . . . .

NSUserDefaults *userDefaults1 = [NSUserDefaults standardUserDefaults];
[userDefaults1 setBool:YES forKey:@"btnM1"];
[userDefaults1 synchronize];
textFontSize = (textFontSize < 140) ? textFontSize +5 : textFontSize;
NSString *jsString = [[NSString alloc] initWithFormat:@"document.getElementsByTagName('body')[0].style.webkitTextSizeAdjust= '%d%%'", textFontSize];
[_webview stringByEvaluatingJavaScriptFromString:jsString];

webviewDidFininshLoading:

NSUserDefaults *menuUserDefaults = [NSUserDefaults standardUserDefaults] if([menuUserDefaults boolForKey:@"btnM1"]){
[_webview setOpaque:NO];
[_webview setBackgroundColor:[UIColor whiteColor]];
NSString *jsString2 = [[NSString alloc] initWithFormat:@"document.getElementsByTagName('body')[0].style.webkitTextFillColor= 'black'"];
[_webview stringByEvaluatingJavaScriptFromString:jsString2];

, +5 -5 , , . , .

0

All Articles