Gandalf458
Gandalf458

Reputation: 2269

How do I make two constraints match each other in iOS Storyboard?

I have a view that is sized to the width of the screen with a 1x1 ratio of width to height (matching height). I have a view below that square view that is a set height from the bottom. What I want is for the top view to be centered in the blank space. So I would love to just set 1 constraint for the top and 1 constraint for the bottom to say, match. Then if there are x number of points of available, each constraint should be size x / 2.

So far, I haven't been able to find a constraint setting that can do this. Could someone describe how to do this?

Upvotes: 2

Views: 1237

Answers (1)

Wain
Wain

Reputation: 119031

Generally you add 2 transparent views, 1 above and 1 below, pin the edges to your existing views and set the 2 new views to have equal height.

Upvotes: 2

Related Questions