Does TTStyledText textFromXHTML not support the underline tags?
I note for the the following code the bold'ing works, however the underline portion doesn't seem to?
NSString* htmlTitle = [NSString stringWithFormat:@"UnderlinedBoldNormal", w开发者_如何转开发e.title];
self.ttTitlelabel.text = [TTStyledText textFromXH`TML:htmlTitle];
Nope I don't think so. The amount of formatting that TTStyledText
supports is pretty limited
There is no native support for underlined or strikethrough fonts on iOS. However you can overcome this by drawing your own line. A style could be created in your stylesheet:
- (TTStyle*)underlineStyle
{
//custom TTStyle implementation
}
You could then get underlined text by:
NSString* htmlTitle = [NSString stringWithFormat:@"<span class=\"underlineStyle\">%@</span>", we.title];
self.ttTitlelabel.text = [TTStyledText textFromXHTML:htmlTitle];
精彩评论