title: Xcode storyboard constraints and auto layout
body: <p>I'm working on an app at the moment and one thing that I've been struggling with for the past two weeks has been auto layout. I'm new to iOS programming so I'm not exactly sure the best way to explain my problem but here goes.</p>
  
  <p>I'm making a piano app and the way it works is that my keyboard is just a bunch of buttons laid out next to each other.</p>
  
  <p><a href="https://i.stack.imgur.com/AZD3t.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/AZD3t.png" alt="enter image description here"></a></p>
  
  <p>These buttons represent the keys. The buttons have a background image of an image of a regular piano key. Now my problem is that I have a black above the keys and whenever I try to use the pin tool to create constraints for my piano keys, as soon as i add the constraints everything gets pushed up and my keys get stretched vertically. </p>
  
  <p><a href="https://i.stack.imgur.com/ddPFo.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ddPFo.png" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/Jf9mc.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Jf9mc.png" alt="enter image description here"></a></p>
  
  <p>I've been working hours non stop this past week not knowing what's wrong. I've followed manny tutorials but the one's I follow are very basic and at most have a few labels or buttons separated by a ton of space. I'm not sure if it's because my buttons are not spaced out enough or what but it's just extremely frustrated. Any help, or guides/tutorials would be super helpful...</p>
  
  <p>Also I've tried checking the boxes that say to width and height to maintain the width and height however that just makes the keys either too huge or too small on some devices. Is there a way to stretch these keys so they adapt to their device? I've heard of intrinsic size content but don't know how that would apply with over 24 buttons...</p>
  
  <p>Edit:
  I tried a stack view but all my white keys got spaced out and went out of the storyboard:</p>
  
  <p><a href="https://i.stack.imgur.com/6u34z.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6u34z.png" alt="enter image description here"></a></p>