I have a UIView with 3 UIViews as its subviews. I have set layout constraints for these subview as fixed aspect ratio. i.e if the screen size changes their width will change but aspect ratio will always be the same.
Now i have also made width of the UIView (the red one as shown in screen shot) changing as the screen size changes. But i am struggling to make constraint for height of this view. what i want is its height should be set according to the total height of the subviews inside it.
since the height of the subviews will change if the width of the screen changes, because i have made their aspect ratios fixed.
As of right now i have made height of the Red superview fixed. but i want it to be variable according the total height of all the subviews inside it.
Here is the screen shot of my viewcontroller and its preview.
As you can see there is some space remaining because of the fixed height of red super view.
Details of the constraints i have added so far are as bellow.
Main Red SuperView
**1st (Top), 2nd (Middle), 3rd (Bottom) Subviews respectively **