In this case, this color:#fff tag color:#fff used for the text color. #Fff black color is used.
NSString *webStr =@ "Your text use"; [self._webview loadHTMLString:[NSString stringWithFormat:@"<div id ='foo' align='left' style='line-height:18px; float:left;width:300px; font-size:13px;font-family:helvetica;background-color:transparent; color:#fff;>%@<div>",webStr] baseURL:nil];
if you use local html use
NSString *htmlFile = [[NSBundle mainBundle] pathForResource:@"sample" ofType:@"html"]; NSString* text = [NSString stringWithContentsOfFile:htmlFile encoding:NSUTF8StringEncoding error:nil]; NSLog(@"%@",htmlFile); NSLog(@"Hello"); [self._webview loadHTMLString:[NSString stringWithFormat:@"<html><body bgcolor=\"#000000\" text=\"#FFFFFF\" face=\"Bookman Old Style, Book Antiqua, Garamond\" size=\"5\">%@</body></html>", text] baseURL: nil];
Deepesh
source share