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

 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

猜你喜欢

转载自blog.csdn.net/flyingfirefish/article/details/80563117