iOS7 Webview初始滚动位置在导航栏下方

编程入门 行业动态 更新时间:2024-10-28 19:25:45
本文介绍了iOS7 Webview初始滚动位置在导航栏下方的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有一个webview,可以根据需要滚动导航栏。

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

但是,当我第一次加载控制器时,webview中加载的页面会滚动它与导航栏的顶部对齐。当我滚动网页视图时,正确的插入位于顶部以便正确放置,它只是初始位置不正确。

However, when I first load the controller, the page loaded in the webview is scrolled so that it aligns with the top of the navigation bar. When I scroll the web view, the correct inset is present at the top to sit correctly, it's just the initial position that is incorrect.

如何获得初始位置要完全滚动到顶部,包括插图?

How can I get the initial position to be fully scrolled to the top, including the inset?

推荐答案

如果你不介意有一个不透明的导航栏,那么最简单的解决方案可能是在包含您的Web视图的视图控制器中执行此操作:

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;

框架的定位将采用与iOS6相同的行为,神奇地!

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

更多推荐

iOS7 Webview初始滚动位置在导航栏下方

本文发布于:2023-10-08 03:29:40,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1471391.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:位置   Webview

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!