您好,欢迎来到瑞奇养生。
搜索
您的当前位置:首页UILabel可以显示html文本_html/css

UILabel可以显示html文本_html/css

来源:瑞奇养生


NSString * htmlString = @" Some html string \n This is some text! ”;

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

UILabel * myLabel = [[UILabel alloc] initWithFrame:self.view.bounds];

myLabel.attributedText = attrStr;

[self.view addSubview:myLabel];

Copyright © 2019- rqyg.cn 版权所有

违法及侵权请联系:TEL:199 18 7713 E-MAIL:2724546146@qq.com

本站由北京市万商天勤律师事务所王兴未律师提供法律服务