Search code examples
iosobjective-cautolayoutnavigationbaruistatusbar

How to load UIWebView underneath Navigation bar until StatusBar


Hi I have a VC with a UIWebView and a NavigationBar. When I set the Top Constraint of my webview.Top to Superview and the constant to 0, The web view does not load until the status bar and only load until the navigation bar. Why is it like that? See the following pic.

Pic

Pic2

Then if I set the webView.Top to SuperView constant to -60. I will get my ideal output. But I don't think that is the correct way. Can anyone please advice.

The ideal output:

Pic3

Pic4


Solution

  • I pushed the webView Top Constraint to -45 to SuperView. This will push the webView up.

    I can't find any other answer.