美文网首页
iOS 处理html格式字符串

iOS 处理html格式字符串

作者: keyuan0214 | 来源:发表于2018-01-17 14:09 被阅读0次

//处理html格式字符串

        NSMutableAttributedString * attrStr = [[NSMutableAttributedString alloc] initWithData:[longAnswerArray[0] dataUsingEncoding:NSUnicodeStringEncoding] options:@{ NSDocumentTypeDocumentAttribute: NSHTMLTextDocumentType } documentAttributes:nil error:nil];

        [attrStraddAttribute:NSParagraphStyleAttributeName

                        value:_paraStyle

                        range:NSMakeRange(0, attrStr.length)];

        cell.checkLabel.attributedText= attrStr;

//        cell.checkLabel.text = longAnswerArray[0];

        cell.checkLabel.font= [UIFontsystemFontOfSize:15.0];

相关文章

网友评论

      本文标题:iOS 处理html格式字符串

      本文链接:https://www.haomeiwen.com/subject/fafuoxtx.html