title: How to fix why status bar space behind ScrollView in Xcode?
body: <p>I added a scroll view to my view which is hover the status bar (I hid it). The scroll view is working fine, but when I'm scrolling to the top, I have a white space which disappears when I tap on my screen, and appears again when I scroll down then top. </p>
  
  <p>I noticed that the scroll bar is not going to the top of my view, but stopped at the status bar.</p>
  
  <p>Here are screenshots which show you what I mean.</p>
  
  <p>Here I'm at the top of my view but the scroll bar isn't:</p>
  
  <p><img src="https://i.stack.imgur.com/mzYPm.png" width="300" /></p>
  
  <p>Here is the same view with the white status bar which appears when I scroll top again:</p>
  
  <p><img src="https://i.stack.imgur.com/w5fm5.png" width="300" /></p>
  
  <p>It disappear when I tap on my screen or scroll down.</p>
  
  <p>Here are my constraints:</p>
  
  <p><a href="https://i.stack.imgur.com/yDhn8.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/yDhn8.png" alt="constraints"></a></p>
  
  <p>I think it's a problem of Layout Margin or something like that, but I don't what I should change?</p>
  
  <p>I hide the status bar like that in my view controller:</p>
  
  <pre><code>override func viewWillAppear(_ animated: Bool) {
      UIApplication.shared.keyWindow?.windowLevel = UIWindowLevelStatusBar
  
      super.viewWillAppear(animated)
  }
  </code></pre>
  
  <p><strong>EDIT:</strong> Even if I comment the line which hides the status bar, I still have the same problem with my scroll view. So the problem doesn't come from how I hide it.</p>