Top space on device rotation
<p>I have the following constraints on my UIView in portrait mode:</p>

<p><a href="https://i.stack.imgur.com/ALZW8.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ALZW8.png" alt="Portrait"></a></p>

<p>And landscape:</p>

<p><a href="https://i.stack.imgur.com/Bu3Mh.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Bu3Mh.png" alt="Landscape"></a></p>

<p>This is screenshot of the ViewController when I open it first time:</p>

<p><a href="https://i.stack.imgur.com/Kkior.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Kkior.jpg" alt="Portrait 1"></a></p>

<p>Top space is OK.</p>

<p>Then I'm rotating the device to landscape:</p>

<p><a href="https://i.stack.imgur.com/6JPCI.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6JPCI.jpg" alt="Landscape"></a></p>

<p>Do you see that white space on the top?</p>

<p>And when I'm rotating it back to landscape, the space still stays:</p>

<p><a href="https://i.stack.imgur.com/6PohI.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6PohI.jpg" alt="Portrait 2"></a></p>

<p>Why and how to fix it?</p>