I have an uiwebview and i load the followin NSString text
NSString *htmltext=@"Likes: @Amore , @George , @Morfy ...";
Then i load it to the uiwebview like this defining a color in hex
[wholikes loadData:[[NSString stringWithFormat:@"<html> <head><style>BODY { font-family: 'Times New Roman'; font-size: 14px; word-wrap: break-word}</style></head><body text=\"#645a49\">%@</body></html>", htmltext] dataUsingEncoding:NSUTF8StringEncoding]
MIMEType:@"text/html"
textEncodingName:@"UTF-8"
baseURL:nil];
Is there a way to change part of uiwebview text? I want “Likes:” to be presented in another color.
Any help appreciated.
Simply split your string into two and insert them with the appropriate HTML formatting into your format string. Thus