iOS 富文本加载html使图片宽高自适应

UILabel*detailLab = [[UILabelalloc] init]; detailLab.numberOfLines = 0; [_tableHeaderView addSubview:detailLab];NSString*detailTextString = [NSStringstringWithFormat:@"%@",_headerDataDic[@"art_content"]];NSString*str = [NSStringstringWithFormat:@"%@",self.view.width - 30,detailTextString];NSMutableAttributedString*attributeString = [[NSMutableAttributedStringalloc] initWithData:[str dataUsingEncoding:NSUnicodeStringEncoding] options:@{NSDocumentTypeDocumentAttribute: NSHTMLTextDocumentType} documentAttributes:nilerror:nil]; detailLab.attributedText = attributeString;



 

你可能感兴趣的:(iOS 富文本加载html使图片宽高自适应)