0

In my application I am loading HTML String which is parsed from the xml file I need to change the color, name and size of the font. To replace that I have already use the followings code but its not working

NSString *webString = [[NSString alloc] initWithFormat:@"document.getElementsByTagName('body')[0].style.webkitTextSizeAdjust= '%d%%'", 
                      textFontSize];
    [web stringByEvaluatingJavaScriptFromString:webString];

Is there any way then please suggest me the answer.

Thanks in Advanced!!!

rmaddy
  • 314,917
  • 42
  • 532
  • 579
kagmanoj
  • 5,038
  • 5
  • 19
  • 21

1 Answers1

1

Use NSAttributedString instead. Here's the docs from Apple. You can set the font type, colour, and size. You can then convert NSAttributedString back to HTML this way.

It's only available on iOS 6 and above.

Community
  • 1
  • 1
Enrico Susatyo
  • 19,372
  • 18
  • 95
  • 156