HTML字符串是:
<p> Business Name and City Located In <i class=\"fa fa-check\"></i></p>\r\n
答案 0 :(得分:0)
let webview = UIWebView(frame: CGRect(x: 0, y: 0, width: 300, height: 300))
let htmlString = "<p> Business Name and City Located In <i class=\"fa fa-check\"></i></p>\r\n"
let fontAwesomeHtml = """
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">\(htmlString)
"""
webview.loadHTMLString(fontAwesomeHtml, baseURL: nil)
view.addSubview(webview)
结果截图: