2
我发现这个代码HTML中的UILabel(IOS)格式
let attrStr = try! NSAttributedString(
data: (text?.data(using: String.Encoding.unicode, allowLossyConversion: true)!)!,
options: [ NSDocumentTypeDocumentAttribute: NSHTMLTextDocumentType],
documentAttributes: nil)
这将返回属性串。但字体变得太小而且与我想要的不同。我怎么能设置该字符串的默认字体?
无论您列举NSFontAttributeName并改变它,或者你添加一个新的HTML标记来改变它:http://stackoverflow.com/questions/20992950/ios7-font-大小变化时创建-nsattributedstring从 - HTML – Larme