Reputation: 2614
I'm trying to set autolayout for a view controller with subview align vertically as you can see in the pic. The result I want is when ever screen size change, each subview will scale but preserve it aspect ratio and align center, except the last one will need to have enough space for textfield and button inside it
What I have tried so far:
Despite what I tried, when screen size change, only first and last subview get scale (bigger or smaller), but I want all of them scale accordingly as describe above. Which constraint should I set to achieve it?
Upvotes: 0
Views: 143
Reputation: 17860
If you want all of them to scale proportionally you would need to add constraints to hold relation between their sizes. Specifying that second rect has half of the first height and so on.
Upvotes: 1