title: Equal width and equal spacing between buttons in autolayout
body: <p>I'm trying to use autolayout constraints to automatically resize a few similarly-sized buttons in a view to give the following effect:</p>
  
  <p><strong>Before resizing</strong></p>
  
  <p><img src="https://i.stack.imgur.com/GWLGt.png" alt="Before stretching"></p>
  
  <p><strong>Desired effect after resizing</strong></p>
  
  <p><img src="https://i.stack.imgur.com/ORrDs.png" alt="After stretching"></p>
  
  <p>As you can tell, I want the buttons to be of the same size and I also want the spacing between each button to be a constant 20 points. It seems pretty simple at first, so I set the following constraints:</p>
  
  <ul>
  <li>Buttons: space from left neighbour = 20 (inclusive of left-most and right-most buttons)</li>
  <li>Buttons: space from right neighbour = 20 (inclusive of left-most and right-most buttons)</li>
  <li>Buttons: same width</li>
  </ul>
  
  <p><strong>What actually happens after resizing</strong></p>
  
  <p><img src="https://i.stack.imgur.com/52ser.png" alt="enter image description here"></p>
  
  <p>When in preview or when I test run the app in my iPhone/simulator, the button resizes and doesn't even follow the same width constraint I set for it. In fact, the view containing the views also resizes to fit the new button sizes. Anyone knows how to fix this problem purely in the interface builder?</p>