Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Display UIWebView from HTML string with custom font and size

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 5.59k
    Comment on it

    Following code can be used to change the font and size of UIWebView displayed from HTML string. To implement this first change the font and size of HTML string then load the UIWebView with this string like below.

    UIFont *font = [UIFont fontWithName:@"OpenSans" size:12];
     NSString *htmlString = [NSString stringWithFormat:@"<span style=\"font-family: %@; font-size:             %i\">%@</span>",font.fontName, (int) font.pointSize, yourHTMLString];
    [webViewObject loadHTMLString:htmlString baseURL:nil];
    

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: