Vertically center view between two others

Viewed 4042

I wondered how to use constraints to center an object between two others vertically. I use storyboards. The label and the button have constraints using autolayout (label: top, leading, trailing, height; button: bottom, leading, trailing, aspect ratio).

Here is how all that looks like:

Here is a schematic of my UI.

I want constraint 1 and 2 (take a look at the image) to be the same length so that 'view' is vertically centered between 'label' and 'button'. Placing hidden views with the same height in between didn't work for me in smaller screen sizes. Thank you!


PS: One important thing is: I want the view to be centered and not all elements equally spaced!

2 Answers
Related