[关闭]
@lvcloud 2016-09-08T05:12:33.000000Z 字数 273 阅读 309

Swift 给UILable使用html语法

swift xcode


  1. let attrStr = try! NSAttributedString(data: "<p>日本語</p>".dataUsingEncoding(NSUnicodeStringEncoding, allowLossyConversion: true)!, options: [NSDocumentTypeDocumentAttribute: NSHTMLTextDocumentType], documentAttributes: nil)
  2. tempLabel.attributedText = attrStr
添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注