iOS7 Webview initial scroll position under Navigation bar

后端 未结 8 2605
[愿得一人]
[愿得一人] 2021-02-18 22:50

I have a webview which is scrolling as desired underneath a navigation bar.

However, when I first load the controller, the page loaded in the webview is scrolled so that

8条回答
  •  青春惊慌失措
    2021-02-18 23:30

    If you don't mind having an opaque navigation bar, then the simplest solution could be to do this in the view controller that contains your web view:

    self.navigationController.navigationBar.translucent = NO;
    

    The positioning of the frame will then adopt the same behavior as iOS6, magically!

提交回复
热议问题