xcode Html 字符串设置为 UILabel
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/5580244/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Html string set into UILabel
提问by Hiren
I am getting NSString with contain some html tag.
Now I want to set this string into UILabel with working of this html tag
我得到的 NSString 包含一些 html 标签。
现在我想将此字符串设置为 UILabel 并使用此 html 标记
采纳答案by saadnib
To convert HTML to plain text Download File
将 HTML 转换为纯文本下载文件
and use
并使用
stringByConvertingHTMLToPlainText
function on your string.
stringByConvertingHTMLToPlainText
函数在你的字符串上。
回答by malinois
You can use DTCoreText(previously known as NSAttributedString Additions for HTML).
您可以使用DTCoreText(以前称为 HTML 的 NSAttributedString Additions)。