I'm trying to lay out the following simple UI using auto layout:
So far, I've set 5 constraints:
- The left edge of the textfield is constrained to the left alignment guide
- The top edge of the textfield is contained to the top alignment guide
- The right edge of the label is constrained to the right alignment guide
- The top edge of the label is constrained to the top alignment guide
- The right edge of the textfield is constrained to be 20 points from the leading edge of the label
Based on these constraints, I would think that the width of the textbook would be determined by the size of the label, and horizontal layout for both would be implied. This is indeed how these constraints behave when I change the size of the button, but I'm still receiving the following warning in xcode:
My question is why? Width and horizontal position can be determined by the information provided, and providing additional information (like a fixed width) would only mess with the flexibility of the interface.