title: iOS: UIView wont stick behind status bar
body: <p>I want to create a status bar with a black opaque background and white text. To do this I did the following:</p>
  
  <ol>
  <li>In my .plist set the "UIViewControllerBasedStatusBarAppearance" to "NO"</li>
  <li>In my .plist set the "UIStatusBarStyle
  LightContent" to "UIStatusBarStyleLightContent"</li>
  <li>Create an UIView in my storyboard with the following constraints:</li>
  </ol>
  
  <p><a href="https://i.stack.imgur.com/4EBMR.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4EBMR.png" alt="Status bar UIView"></a></p>
  
  <p>Now I have a status bar with white text and an opaque background, like this (Ignore the background picture):
  <a href="https://i.stack.imgur.com/SpF8t.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SpF8t.png" alt="Status Bar"></a></p>
  
  <p>However when I scroll, the UIView background won't stick underneath the statusbar, for example:</p>
  
  <p><a href="https://i.stack.imgur.com/ChfkI.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ChfkI.png" alt="Status bar without a BG"></a></p>
  
  <p>This probably has to do with the vertical constraint, which should link to the top layout guide instead of the superview, but this constraint is not showing in xcode and I have no idea what else could be wrong.</p>