HTML String content for UILabel and TextView

前端 未结 1 398
清酒与你
清酒与你 2021-01-03 13:51

i got an object with contents of html markup in it, for example:

string = @\"

This is wonderful

Also some ‘ entidies &am

相关标签:
1条回答
  • 2021-01-03 13:59

    You should have a look at the Three20 project which includes a class TTStyledTextLabel which allows you to render HtmL-Code and even activates links.

    TTStyledTextLabel  *htmlLabel = [[[TTStyledTextLabel alloc] initWithFrame:self.contentView.bounds] autorelease];
    htmlLabel.userInteractionEnabled = YES;
    [aView addSubview:htmlLabel];
    
    htmlLabel.text = [TTStyledText textFromXHTML:htmlText];
    
    0 讨论(0)
提交回复
热议问题