2

I need to create a Webview in my application.

As you may know, WKWebview have been fixed in IOS 11 and his initialization is storyboard is impossible if you want your application to be compatible with lower versions of IOS (more information here). The only way to use it is to init it in the code :

override func loadView() {
    super.loadView()
    let webConfiguration = WKWebViewConfiguration()
    self.webView = WKWebView(frame: currentView.bounds, configuration: webConfiguration)
    self.webView.uiDelegate = self
    webView.autoresizingMask = [.flexibleWidth, .flexibleHeight]
    currentView.addSubview(self.webView)
}

(currentView is a view in the storyboard)

The problem is that I have now a display bug in IOS 10.3 that is not in IOS 11. The navbar of the website I want to put in the WKWebView isn't fixed on the top of the screen when you scroll down, as you can see in this photo :

bug on left and correct version on right

(bug on left and correct version on right)

Is there any way to fix the navbar?

0 Answers0