You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When embed in tableViewCell, need update everytimes after load markdown, but onRendered callback height is before when before height is larger than new actual height, so I add the below method to get the actual height
public func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) {
// 获取内容实际高度
webView.evaluateJavaScript("document.body.scrollHeight") { [unowned self] (result, error) in
DispatchQueue.main.async { [unowned self] in
if let tempHeight: Double = result as? Double {
let height = CGFloat(tempHeight) + 10
debugPrint("height ==== \(height)")
self.onRendered?(height)
}
}
}
}
The text was updated successfully, but these errors were encountered:
When embed in tableViewCell, need update everytimes after load markdown, but onRendered callback height is before when before height is larger than new actual height, so I add the below method to get the actual height
The text was updated successfully, but these errors were encountered: