I have to show rich text that i pull from server, so i'm using UIWebView. Now the problem is that i have no control over the font which is used in UIWebView. How can i change the font to use system font (making it consistent with rest of the application)?
I'm doing something like this at the moment:
myRichTextView = [[UIWebView alloc] initWithFrame:CGRectMake(x, y, width, height)]; myRichTextView.backgroundColor = [UIColor clearColor]; [myRichTextView setScalesPageToFit:NO]; [myRichTextView loadHTMLString:myString baseURL:[NSURL URLWithString:myBaseURL]];
Again, need to control the display font. If i can't control the font, please let me know other alternatives to UIWebView.
Thanks
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];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With