uinavigationbar - Swift - Webview is overlay by navigation bar after implement Javascript -
i'm implementing javascript functions inside ios app using swift , it's worked. web view size overlay navigation bar. before implement javascript, web view size correct. how fix it?
my reference function : https://kinderas.com/technology/2014/6/15/wkwebview-and-javascript-in-ios-8-using-swift
@iboutlet var containerview: uiview! var availabilitywebview: wkwebview? override func loadview() { super.loadview() let contentcontroller = wkusercontentcontroller(); let userscript = wkuserscript( source: "redheader()", injectiontime: wkuserscriptinjectiontime.atdocumentend, formainframeonly: true ) contentcontroller.adduserscript(userscript) contentcontroller.add( self, name: "callbackhandler" ) let config = wkwebviewconfiguration() config.usercontentcontroller = contentcontroller //something wrong here self.availabilitywebview = wkwebview( frame: self.containerview.bounds, configuration: config ) self.view = self.availabilitywebview! }
override func viewwillappear
let url = url(string: "http://ec2-52-221-231-3.ap-southeast-1.compute.amazonaws.com/gv/available-schedule_3.php?id=\(crewid)") self.availabilitywebview?.load(urlrequest(url:url!))
i solved problem adding code in viewdidload
self.edgesforextendedlayout = []
wiki
Comments
Post a Comment