Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- self.mapWebView.delegate = self
- let mapHtmlFile = Bundle.main.path(forResource: "map", ofType: "html")
- let html = try? String(contentsOfFile: mapHtmlFile!, encoding: String.Encoding.utf8)
- self.mapWebView.loadHTMLString(html!, baseURL: nil)
- func webViewDidFinishLoad(_ webView: UIWebView) {
- webView.frame.size.height = 1
- webView.frame.size = webView.sizeThatFits(.zero)
- webView.scrollView.isScrollEnabled=false;
- self.cnDirectionWebViewHeight.constant = webView.scrollView.contentSize.height
- webView.scalesPageToFit = true
- // tried following code. Doesn't work
- //webView.frame.size.height = 1
- //webView.frame.size = webView.sizeThatFits(CGSize.zero)
- }
Add Comment
Please, Sign In to add comment