美文网首页
Swift webView 加载富文本字符串 (Swift4)

Swift webView 加载富文本字符串 (Swift4)

作者: KingWorld | 来源:发表于2021-08-29 00:39 被阅读0次
let headerS = "<html lang=\"zh-cn\"><head><meta charset=\"utf-8\"><meta name=\"viewport\" content=\"width=device-width, nickName-scalable=no\"></meta><style>img{max-width: 100%; width:auto; height:auto;}</style></head><body>"

let endS = "</body></html>"

let content = headerS + "富文本字符串" + endS

self.detailWebView.loadHTMLString(content, baseURL: nil)

self.detailWebView.scalesPageToFit = true

相关文章

网友评论

      本文标题:Swift webView 加载富文本字符串 (Swift4)

      本文链接:https://www.haomeiwen.com/subject/hfqwiltx.html