iPhone Development - Setting UIWebView font

Solution 1:

It worked when i modified the string like this. Your right chris, it shouldn't make any difference.

NSString *myDescriptionHTML = [NSString stringWithFormat:@"<html> \n"
                                "<head> \n"
                                "<style type=\"text/css\"> \n"
                                "body {font-family: \"%@\"; font-size: %@;}\n"
                                "</style> \n"
                                "</head> \n"
                                "<body>%@</body> \n"
                                "</html>", @"helvetica", [NSNumber numberWithInt:kFieldFontSize], content];

Solution 2:

Reference a css style sheet in your HTML document or put the style information into the top of the HTML document itself

Solution 3:

I use the following CSS in a web view to do exactly what you are saying.

body
{
    font-family:helvetica;
}

But yours looks the like it should work as well. Strange. Only difference I can see is the font vs font-family, but that shouldn't make a difference.

chris.