2

The status bar overlaps with the top of my webview, exactly how it looks in this post. However my situation is different from his, because the overlap is only present at the very first load of the webivew, before any of these things happen:

Things that will make the webview spaced properly:

  • I switch away from the tab of the webview, and switch back
  • I press any of the js buttons on the page
  • I rotate the device

Example vid of 1 and 2 on the list

In the video, it starts with showing wikipedia improperly spaced, but once I press the sidebar button, it fixes the spacing. Then I scroll to stackoverflow.com, it is improperly spaced, but when I scroll away and come back it fixes itself.

I have all of my webviews constrained with Webview.top = Top Layout Guide.bottom

It happens with classes as simple as this:

class testweb: UIViewController {
    @IBOutlet weak var webview: UIWebView!

    override func viewDidLoad() {
         let url = NSURL (string: "https://stackoverflow.com")
         let requestObj = NSURLRequest(URL: url!)
         webview.loadRequest(requestObj)
    }
}

It happened before I added the animation. It happens in the simulator, on a real device, and on both iOS 8 and 9

Any ideas?

Community
  • 1
  • 1
George John
  • 118
  • 1
  • 7

0 Answers0