Reputation: 17822
I have 2 UILabels above 2 UITextFields. I would like the first UITextField to expand when the screen size allows it.
I set vertical spacings between each elements, and fixed height constraint for the UITextField at the bottom and a >= height constraint for the first one.
Below is a screenshot with what it looks like with the retina 3.5 form factor (<= iPhone 4).
But, it just doesn't work. Below is a screenshot of the storyboard with the retina 4 form factor (>= iPhone 5). The first UITextField overlaps the second one.
What constraints should I set ?
Upvotes: 0
Views: 4351
Reputation: 3271
The orange (-78) is Xcode's way of telling you you have a conflict between the frames of your layout and the autolayout constraints. Try looking at the storyboard warnings and fix the frame or fix the layout constraint.
Upvotes: 2
Reputation: 26972
If i had it in front of me I'd play around with the compression resistance properties, which would be more elegant than fixed heights... however....a crude way of doing it that would work is:
Upvotes: 2