您好,欢迎来到调星娱乐。
搜索
您的当前位置:首页UILabel用原生方法显示HTML文本_html/css_WEB-ITnose

UILabel用原生方法显示HTML文本_html/css_WEB-ITnose

来源:调星娱乐


NSString * htmlString = @"今天中午去哪吃什么??? "; 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- dxga.cn 版权所有 湘ICP备2023023988号-8

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

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