NSString * htmlString = resultDic[@"Result"][@"Content"];
NSAttributedString * attrStr = [[NSAttributedString alloc] initWithData:[htmlString dataUsingEncoding:NSUnicodeStringEncoding] options:@{ NSDocumentTypeDocumentAttribute: NSHTMLTextDocumentType } documentAttributes:nil error:nil];
UILabel * myLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, DeviceWidth, DeviceHeight/2)];
myLabel.attributedText = attrStr;
myLabel.numberOfLines = 0;
myLabel.font =[UIFont systemFontOfSize:11.0];
[self.view addSubview:myLabel];
iOS UILabel 加载 HTML文字
最新推荐文章于 2023-09-07 15:23:43 发布