How to make an automatic layout for a universal app

Now I am making a universal application; I am having problems with automatic layout; I need to make two views the same size on all devices; I was working on a storyboard with a view of WAny hAny; and here are the images that I achieveenter image description here

The problem on the iPad the bottom view is very big and I need these two vies almost the same height as in the attached photo for iPhone-4inch

The following pictures showed my limitations to be viewed from above enter image description here and the following: enter image description here

if I make the same height there is a photo enter image description here and at the same time restrictions enter image description here and here is an output enter image description here

here is the modification as you see the iPad, the bottom view is the problem layouttopViewbottom View

+3


source to share


2 answers


If you want both views to have the same height, give them equal height constraints and remove the constraint between the bottom view and the top of the supervisor. You make a height limitation by selecting both views and choosing "Equal heights" from the contacts menu. If you want them not to be the same, you can change this constraint to change the multiplier value to whatever you want.



0


source


In the top view, set the left and right constraints, on the bottom bottom of the bottom, equal width, align leading and equal heights. Set the vertical distance between both views.



Equal spacing

+1


source







All Articles