title: making adaptive layout for all iPhone devices
body: <p>I'm learning Swift now and I'm trying to make UIs for my personal project. I watched some of the autolayout, stack views, and adoptive layout tutorials, but I cannot display UIs if the device gets smaller or bigger. The first image below is when I add the top constraint to the label, &quot;welcome&quot;, to 20 points.</p>
  <p><img src="https://i.stack.imgur.com/a0eef.png" alt="enter image description here" /></p>
  <p>I can display all of my UIs, labels, the progress bar, image view, and the button, &quot;check my if then&quot;. I added vertical spacing of 16pt for UIs so, you can see a small gap between those UIs. However, the problem is, it looks ok for the iPhone SE screen, but for the iPhone 11 you see the huge space at the bottom.</p>
  <p>And here is the second image, make the UI image view (a bigger pink square in the middle) vertically centers and lower the UI a little.</p>
  <p><img src="https://i.stack.imgur.com/ByjwU.jpg" alt="enter image description here" /></p>
  <p>Same as the first image, I added 16pt spacing between vertical items, and you will see the small gap between them. But for the iPhone 11, since I put the pink image view vertically centered, both the top and bottom have a bigger gap and the UI looks poorly.</p>
  <p>The layout I want to make is something like this.
  <img src="https://i.stack.imgur.com/WKpn8.png" alt="enter image description here" /></p>
  <p>Even if the screen size changes (and I only care about iPhone screens for now), I can still see the same UIs with smaller version or bigger version. Now I add vertical spacing of 16pt to each UI, so that makes UIs tighten, but not sure how I can change the spacing depends on the screen horizontal sizes. I hope this makes sense. I want to know what I'm missing and should study or any suggestions when I work on making UIs.
  I'm not sure this helps or not, but here are my constraints...
  <img src="https://i.stack.imgur.com/syNlq.png" alt="enter image description here" /></p>
  <p>I'm using interface builder for this project.</p>