• <i id='ciGMC'><tr id='ciGMC'><dt id='ciGMC'><q id='ciGMC'><span id='ciGMC'><b id='ciGMC'><form id='ciGMC'><ins id='ciGMC'></ins><ul id='ciGMC'></ul><sub id='ciGMC'></sub></form><legend id='ciGMC'></legend><bdo id='ciGMC'><pre id='ciGMC'><center id='ciGMC'></center></pre></bdo></b><th id='ciGMC'></th></span></q></dt></tr></i><div id='ciGMC'><tfoot id='ciGMC'></tfoot><dl id='ciGMC'><fieldset id='ciGMC'></fieldset></dl></div>
  • <small id='ciGMC'></small><noframes id='ciGMC'>

      <tfoot id='ciGMC'></tfoot>
        • <bdo id='ciGMC'></bdo><ul id='ciGMC'></ul>
        <legend id='ciGMC'><style id='ciGMC'><dir id='ciGMC'><q id='ciGMC'></q></dir></style></legend>

        UIWebView 从后台返回后在 iOS 7 上更改 contentSize

        时间:2023-10-22
            <bdo id='LdPo7'></bdo><ul id='LdPo7'></ul>
            1. <legend id='LdPo7'><style id='LdPo7'><dir id='LdPo7'><q id='LdPo7'></q></dir></style></legend>

              <small id='LdPo7'></small><noframes id='LdPo7'>

              • <tfoot id='LdPo7'></tfoot>
              • <i id='LdPo7'><tr id='LdPo7'><dt id='LdPo7'><q id='LdPo7'><span id='LdPo7'><b id='LdPo7'><form id='LdPo7'><ins id='LdPo7'></ins><ul id='LdPo7'></ul><sub id='LdPo7'></sub></form><legend id='LdPo7'></legend><bdo id='LdPo7'><pre id='LdPo7'><center id='LdPo7'></center></pre></bdo></b><th id='LdPo7'></th></span></q></dt></tr></i><div id='LdPo7'><tfoot id='LdPo7'></tfoot><dl id='LdPo7'><fieldset id='LdPo7'></fieldset></dl></div>

                  <tbody id='LdPo7'></tbody>

                  本文介绍了UIWebView 从后台返回后在 iOS 7 上更改 contentSize的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  问题:

                  我的 UINavigationBarUITabBar 之间有一个 UIWebView.在 iOS 7 上,当应用程序进入后台并再次返回时,UIWebViewcontentSize 属性似乎发生了变化,因此在其上方出现了一个白色块.

                  I have a UIWebView between my UINavigationBar and UITabBar. On iOS 7, when the app enters background and comes back again, it seems as if the contentSize property of the UIWebView changes so that there is a white block above it.

                  监听UIWebViewcontentSize后,当应用进入前台时(我通过观察UIApplicationDidBecomeActiveNotification查看),有49从它的高度中减去.

                  After monitoring the contentSize of the UIWebView, when the application enters foreground (I check it by observing the UIApplicationDidBecomeActiveNotification), it has 49 substracted from it's height.

                  屏幕截图(已编辑敏感信息):

                  我的设置:

                  我在我的 UIViewController 中使用 UIWebView,该 UIWebView 嵌入在 UINavigationControllerUITabBarViewController 中>.我正在使用情节提要并启用调整滚动视图插图"、从 NIB 调整视图大小"和在 Tob 栏下扩展边缘".在 UIWebView 我没有选中缩放页面以适应".我没有在 viewDidAppearviewWillAppear 方法中做任何事情.我在 iOS 6 上测试过,问题没有出现.另外,我没有使用自动布局.

                  I am using a UIWebView in my UIViewController that is embedded in a UITabBarViewController that is embedded in a UINavigationController. I am using Storyboards and having "Adjust Scroll View Insets", "Resize View From NIB" and "Extend Edges Under Tob Bars" on. On the UIWebView I have unchecked "Scales Page To Fit". I am not doing anything in the viewDidAppear or viewWillAppear methods. I tested it on iOS 6, and the problem doesn't occur there. Also, I am not using auto-layout.

                  相关代码:

                  self.webView.scrollView.scrollEnabled = NO;
                  self.webView.scrollView.bounces = NO;
                  self.webView.scalesPageToFit = NO;
                  

                  监控后的 contentSize &viewDidAppear 中的框架 &appHasGoneInForeground:

                  After monitoring contentSize & frame in viewDidAppear & appHasGoneInForeground:

                  帧从 320x455 变为 320x455contentSize 从 320x504 变为 320x455

                  Frame goes from 320x455 to 320x455 contentSize goes from 320x504 to 320x455

                  有人知道我在这里缺少什么和/或为什么会发生这种情况吗?感谢您的宝贵时间!

                  Does anyone have an idea what I am missing here and/or why this happens? Thanks for your time!

                  推荐答案

                  我在 UIViewController 中使用了一个 UIWebView,该 UIWebView 嵌入在 UINavigationController 中的 UITabBarViewController 中".

                  "I am using a UIWebView in my UIViewController that is embedded in a UITabBarViewController that is embedded in a UINavigationController".

                  Apple 不支持此功能.链接

                  This is not supported by Apple. link

                  ...收容顺序很重要;只有某些安排是有效的.包含的顺序,从孩子到父母,是如下:

                  ...the order of containment is important; only certain arrangements are valid. The order of containment, from child to parent, is as follows:

                  内容视图控制器和容器视图控制器具有灵活的边界(例如页面视图控制器)

                  Content view controllers, and container view controllers that have flexible bounds (such as the page view controller)

                  导航视图控制器

                  标签栏控制器

                  拆分视图控制器

                  我会先尝试一个更简单有效的容器安排,看看它是否能解决问题.请注意,即使您解决了这个特定问题,如果您继续使用您的层次结构,您仍然可能会遇到意外且可能不一致的 UI 问题.

                  I would try a simpler and valid container arrangement first to and see if it resolves the issue. Note that even if you solve this specific issue, if you keep using your hierarchy you may still run into unexpected and possibly inconsistent UI issues.

                  这篇关于UIWebView 从后台返回后在 iOS 7 上更改 contentSize的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:使用 UIWebView,我可以使用自定义字体吗? 下一篇:允许 UIWebView 在没有 Internet 连接的情况下加载 http://localhost:port/pat

                  相关文章

                  <legend id='YLXvT'><style id='YLXvT'><dir id='YLXvT'><q id='YLXvT'></q></dir></style></legend>
                1. <small id='YLXvT'></small><noframes id='YLXvT'>

                    <bdo id='YLXvT'></bdo><ul id='YLXvT'></ul>

                      <tfoot id='YLXvT'></tfoot>
                      <i id='YLXvT'><tr id='YLXvT'><dt id='YLXvT'><q id='YLXvT'><span id='YLXvT'><b id='YLXvT'><form id='YLXvT'><ins id='YLXvT'></ins><ul id='YLXvT'></ul><sub id='YLXvT'></sub></form><legend id='YLXvT'></legend><bdo id='YLXvT'><pre id='YLXvT'><center id='YLXvT'></center></pre></bdo></b><th id='YLXvT'></th></span></q></dt></tr></i><div id='YLXvT'><tfoot id='YLXvT'></tfoot><dl id='YLXvT'><fieldset id='YLXvT'></fieldset></dl></div>