Home > DeveloperSection > Forums > Increase Font size in UIWebView in iOS
Chris S
Chris S

Total Post:48

Points:336
Posted on    November-15-2015 11:21 PM

 iPhone iPhone  Ios  Objective C 
Ratings:


 1 Reply(s)
 379  View(s)
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?



Tarun Kumar

Total Post:213

Points:1635
Supported
Posted on    November-17-2015 11:04 PM

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.


Don't want to miss updates? Please click the below button!

Follow MindStick