Reputation: 20302
I am developing a webview app, which just loads our website. I noticed that the content of the website is showing in the status bar if you scroll down the page. Is this default iOS browser behaviour or can I fix this?
Upvotes: 0
Views: 1868
Reputation: 655
The programmatically approach would be:
view.addSubview(webView)
let guide = view.safeAreaLayoutGuide
webView.topAnchor.constraint(equalTo: guide.topAnchor).isActive = true
webView.leftAnchor.constraint(equalTo: self.view.leftAnchor).isActive = true
webView.rightAnchor.constraint(equalTo: self.view.rightAnchor).isActive = true
webView.bottomAnchor.constraint(equalTo: self.view.bottomAnchor).isActive = true
Upvotes: 0
Reputation: 7669
For iOS 11 and upper OS create this issue during debug time. This will fix for the released version. I have faced this problem many times during work.
Don't know how but it happens.
So you can try to create a release version and check on your device.
Upvotes: 1
Reputation: 507
You need to add your top constraint (a controller with web site) to the safe area. I hope it will fix your problem
EDITED
Here is detailed screenshot how it's can be done: (also, about constraints, check this documentation)
Upvotes: 4