title: Views are Horizontally and Vertically Ambiguous with complex layout
body: <p>I have a <code>UIViewController</code> on my storyboard that has 2 subviews side-to-side horizontally.  I added constraints to fix the leading and trailing edges to a constant (20 pts), and another constraint to keep the widths equal.  If I assume the following, it should be possible to calculate what the width of each subview will need to be:</p>
  
  <ul>
  <li>the subviews do not overlap</li>
  <li>there are no other views present (horizontally, at least)</li>
  <li>the width of the screen (the superview) is known</li>
  </ul>
  
  <p>However, XCode gives me a warning that my views are horizontally ambiguous.  I'm guessing that means that XCode is not making one of these assumptions, but which one is it?  And is there a way for me to instruct XCode to make that assumption?</p>
  
  <p>EDIT: Okay, played with it a bit and got the warning to go away, but it looks like it's not making the first assumption - it's just setting each subview's width to <code>superview.width - 40</code>, and happily burying one view underneath the other.  So the question is how to I stop them from overlapping?</p>
  
  <p>EDIT 2: Okay, my actual screen is a lot more complicated than my simple example.  Here's what I got:</p>
  
  <p><img src="https://i.stack.imgur.com/GkHaF.png" alt="enter image description here"></p>
  
  <p>So in this setup I have 4 views that are vertically and horizontally staggered.  I want the blue, red, and purple views to all be the same <code>subview.frame.size.width = superview.width - 60</code>.  The blue and purple are lined up in the left column, and the red is alone in the right column, and all the gaps (between the two columns and between each column and it's nearest edge) are at a constant (20 pts).  These 3 tables have a variable height, which I will be setting programmatically as described in <a href="https://stackoverflow.com/questions/19252020/xcode-5-auto-layout-embedded-tables">James's answer here</a>.  At the bottom is a pink view that stretches the width of the screen (minus gaps), and sits at a constant 20 pts below either the purple or the red view, whichever is lower (which I'm attempting to do by giving it a spacing constraint of >= 20 to each view, and I hope that it will pick exactly 20 for one of them).  Since all of the heights are dynamic and may not necessarily fit on the screen at the same time, I made their superview a <code>UIScrollView</code> instead of the normal <code>UIView</code>.  </p>
  
  <p>When all is said and done, I'm still getting a warning that all 4 of my views are horizontally ambiguous, and that the pink bar is vertically ambiguous.  I think it's having trouble realizing what is supposed to go next to what, which is why it thinks it's horizontally ambiguous.  And I think it's not picking to place the pink bar exactly 20 pts below either the purple or red views, which is why it thinks it's vertically ambiguous.  Can anyone confirm or deny any of these suspicions?  Or suggest a way around it?  When I run it in the end, I just get this (I made the background of the scroll view yellow, which you can't tell in the storyboard screenshot):</p>
  
  <p><img src="https://i.stack.imgur.com/QAqnf.png" alt="enter image description here"></p>