title: Extra Space (inset) in Scroll View at run time
body: <p><strong>Setup</strong>:</p>
  
  <p>I am working on a view in Xcode 5 that displays a set of textfields. In order to handle scrolling when the keyboard comes up, I am using a scroll view to place my TextFields in. I am using autolayout.</p>
  
  <p><strong>Problem</strong>:</p>
  
  <p>I am struggling with an issue where extra space is being added to the top of my scroll view at run time. Like an inset is being applied to my scroll view, though I have confirmed via logging that the insets are zero.</p>
  
  <p>In my <strong>viewDidLoad()</strong> method implementation I am doing this to confirm values...</p>
  
  <pre><code>UIEdgeInsets contentInsets = UIEdgeInsetsZero;
  self.scrollView.contentInset = contentInsets;
  self.scrollView.scrollIndicatorInsets = contentInsets;
  self.scrollView.contentSize = self.scrollView.bounds.size;
  self.scrollView.contentOffset = CGPointMake(0.0, 0.0);
  
  NSLog(@"Content Size: %f x %f", self.scrollView.contentSize.height, self.scrollView.contentSize.width);
  NSLog(@"Bounds Size: %f x %f", self.scrollView.bounds.size.height, self.scrollView.bounds.size.width);
  NSLog(@"Frame Size: %f x %f", self.scrollView.frame.size.height, self.scrollView.frame.size.width);
  NSLog(@"Inset Size top: %f bottom: %f", self.scrollView.contentInset.top, self.scrollView.contentInset.bottom);
  NSLog(@"Scroll Inset Size top: %f bottom: %f", self.scrollView.contentInset.top, self.scrollView.contentInset.bottom);
  </code></pre>
  
  <p><strong>Output:</strong></p>
  
  <pre><code>2013-10-08 11:38:42.953 test[6440:a0b] Content Size: 455.000000 x 320.000000
  2013-10-08 11:38:42.954 test[6440:a0b] Bounds Size: 455.000000 x 320.000000
  2013-10-08 11:38:42.955 test[6440:a0b] Frame Size: 455.000000 x 320.000000
  2013-10-08 11:38:42.955 test[6440:a0b] Inset Size top: 0.000000 bottom: 0.000000
  2013-10-08 11:38:42.956 test[6440:a0b] Scroll Inset Size top: 0.000000 bottom: 0.000000
  </code></pre>
  
  <p>The space(inset) being added above my first textfield seems to be about equal to the standard navigation header, but that could be coincidence.  </p>
  
  <p>My scroll view is set to a height of <strong>455</strong> with a y value of <strong>64</strong> in order to fit between the navigation status bar and the tab bar along the bottom.</p>
  
  <p>I do not have any layout notifications of potential problems.  The scroll view top and bottom space constraint is positioned to be <strong>0</strong> points (I presume from the status and tab bars.</p>
  
  <p>When running the app and seeing the extra space in the scroll view, the <strong>scroll bars</strong> are only covering the expected space (they not including this extra space as part of the scrollable area).</p>
  
  <p>One last thing to note.  When I perform my keyboard notification logic.  (<a href="https://developer.apple.com/library/ios/documentation/StringsTextFonts/Conceptual/TextAndWebiPhoneOS/KeyboardManagement/KeyboardManagement.html" rel="noreferrer">taken from apple here...</a>) The problem resolves itself, no more space.  Which makes it seem like an initialization issue with what is configured in the storyboard?</p>
  
  <p>Thanks!</p>