INCREASE FONT SIZE IN UIWEBVIEW IN IOS

Chris S

Total Post:48

Points:336
Posted by  Chris S
 660  View(s)
Ratings:
Rate this:

I have created an app using UIWebView, it works perfectly.

But now I have a problem to increase Font size in UIWebView.
Can anyone help tell me, how can I do this?

  1. Tarun Kumar

    Post:214

    Points:1642
    Re: Increase Font size in UIWebView in iOS

    You can use this code:

    NSString*myString = @"Hello...";
    int textFontSize=5;
    NSString*myStr = [NSString stringWithFormat:@"<html><body><script>var str='%@';
                      document.write(str.fontsize(%d).fontcolor('green'));
                      </script></body></html>",myString,textFontSize];
                      [myWebView loadHTMLString:myHTML baseURL:nil];

    I hope this code is helpful for you.

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!