title: iOS - UIView subview has different size than super view
body: <p>I'm creating an <code>UIViewController</code> with a subview that has the same width as the super view and half the height of the super view.</p>
  
  <p>Here is how it looks in the storyboard:</p>
  
  <p><a href="https://i.stack.imgur.com/kOuvV.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/kOuvV.png" alt="Views"></a> </p>
  
  <p>These are the constraints I added vor the <code>View Punkte</code>:</p>
  
  <p><a href="https://i.stack.imgur.com/JCGvM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/JCGvM.png" alt="Constraints"></a></p>
  
  <p>Plus I added the "Equal Height" constraint.</p>
  
  <p>The constraints work correctly. The subview stays the same when I rotate the device.
  But the problem are the frame sizes.</p>
  
  <p>When I print the sizes of both views, that's what Xcode returns (The code is inside <code>ViewDidLoad</code>:</p>
  
  <pre><code>print(self.view.bounds) // returns --&gt; (0.0, 0.0, 375.0, 667.0)
  print(viewPunkte.bounds) // returns --&gt; (0.0, 0.0, 600.0, 300.0)
  </code></pre>
  
  <p>Why is this happening? The width of the <code>viewPunkte</code> is not correct!
  What is the solution to this problem?</p>
  
  <p>Thanks.</p>