Reputation: 518
I'm now doing an universal app; I faced a problems on auto layout; I need to make two views with same size on all devices; I worked on storyboard with view wAny hAny; and here the images I reach
The problem on iPad the bottom view it's very big and I need these two vies almost same height like on the attached photo for iPhone-4inch
The following photos shown my constrains The following for top view and the following for bottom view
if i do equal height there's the photo and herewith the constrains and here the output
here the modification as you see iPad is problem bottom view
Upvotes: 3
Views: 1093
Reputation: 2640
On the upper view set left right and top constraint, on the lower view set bottom, equal width, align leading and equal Heights. Set vertial spacing between both views.
Upvotes: 1
Reputation: 104082
If you want the two views to be the same height, give them an equal height constraint, and eliminate the constraint between the bottom view and the top of the superview. You make an equal height constraint by selecting both views and choosing "Equal Heights" from the pin menu. If you want them to not be exactly equal, you can edit that constraint to change the multiplier value to whatever you want.
Upvotes: 0