Guest User

Untitled

a guest
Oct 22nd, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. self.mapWebView.delegate = self
  2. let mapHtmlFile = Bundle.main.path(forResource: "map", ofType: "html")
  3. let html = try? String(contentsOfFile: mapHtmlFile!, encoding: String.Encoding.utf8)
  4. self.mapWebView.loadHTMLString(html!, baseURL: nil)
  5.  
  6. func webViewDidFinishLoad(_ webView: UIWebView) {
  7. webView.frame.size.height = 1
  8. webView.frame.size = webView.sizeThatFits(.zero)
  9. webView.scrollView.isScrollEnabled=false;
  10. self.cnDirectionWebViewHeight.constant = webView.scrollView.contentSize.height
  11. webView.scalesPageToFit = true
  12.  
  13. // tried following code. Doesn't work
  14. //webView.frame.size.height = 1
  15. //webView.frame.size = webView.sizeThatFits(CGSize.zero)
  16. }
Add Comment
Please, Sign In to add comment