ios - WKWebView content jumping on load -
i've created simple test app reproduce problem reliably , minimize moving parts. contains navigation controller , view controller add wkwebview to. tell wkwebview navigate www.google.ca. once page has loaded, content automatically jumps underneath header bar. reproducible consistently on various simulators/devices running ios 8/9/9.1. below code viewcontroller:
// viewcontroller.swift import uikit import webkit class viewcontroller: uiviewcontroller { let webview = wkwebview() override func viewdidload() { super.viewdidload() view.addsubview(webview) let url = nsurl(string: "http://www.google.ca")! let request = nsurlrequest(url: url) webview.loadrequest(request) webview.frame = view.bounds } }
put webview.frame = view.bounds
before view.addsubview(webview)
Comments
Post a Comment