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     } } 

gif

put webview.frame = view.bounds before view.addsubview(webview)


Comments

Popular posts from this blog

matlab - error with cyclic autocorrelation function -

django - (fields.E300) Field defines a relation with model 'AbstractEmailUser' which is either not installed, or is abstract -

c# - What is a good .Net RefEdit control to use with ExcelDna? -