Note that there are some explanatory texts on larger screens.

plurals
  1. POUIWebView changes contentSize on iOS 7 after coming back from background
    text
    copied!<p><strong>The Problem:</strong></p> <p>I have a <code>UIWebView</code> between my <code>UINavigationBar</code> and <code>UITabBar</code>. On iOS 7, when the app enters background and comes back again, it seems as if the <code>contentSize</code> property of the <code>UIWebView</code> changes so that there is a white block above it. </p> <p>After monitoring the <code>contentSize</code> of the <code>UIWebView</code>, when the application enters foreground (I check it by observing the <code>UIApplicationDidBecomeActiveNotification</code>), it has 49 substracted from it's height. </p> <p><strong>Screenshot (redacted sensitive info):</strong> <img src="https://i.stack.imgur.com/geA78.png" alt="Redacted version of the screenshot"></p> <p><strong>My Settings:</strong> </p> <p>I am using a <code>UIWebView</code> in my <code>UIViewController</code> that is embedded in a <code>UITabBarViewController</code> that is embedded in a <code>UINavigationController</code>. I am using Storyboards and having "Adjust Scroll View Insets", "Resize View From NIB" and "Extend Edges Under Tob Bars" on. On the <code>UIWebView</code> I have unchecked "Scales Page To Fit". I am not doing anything in the <code>viewDidAppear</code> or <code>viewWillAppear</code> methods. I tested it on iOS 6, and the problem doesn't occur there. Also, I am not using auto-layout.</p> <p><strong>Relevant Code:</strong></p> <pre><code>self.webView.scrollView.scrollEnabled = NO; self.webView.scrollView.bounces = NO; self.webView.scalesPageToFit = NO; </code></pre> <p><strong>After monitoring contentSize &amp; frame in <code>viewDidAppear</code> &amp; <code>appHasGoneInForeground</code>:</strong></p> <p>Frame goes from 320x455 to 320x455 contentSize goes from 320x504 to 320x455</p> <p>Does anyone have an idea what I am missing here and/or why this happens? Thanks for your time!</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload