I am working on a UI where I have 3 labels. All are arranged vertically-
Label 1
Label 2
Label 3
- List item At a time any two Label will be shown to user.
- For example if Label 1 and Label 3 are shown then I want to shift Label3 up below the label1 and make Label2 height to 0.
- If Label2 and Label3 are shown we have to shift both label up and set label1 height to 0. So everytime topmst label should have same top margin from superview. It can be either Label1, Label2 or Label3
Should I use stack view to achieve this requirement?
What is the best way to do it using auto layout?
UIStackViewfor this. Whichever label you need to eliminate, you just have to make that label hidden. That's it. Every other label will adjust their positioning accordingly. - nayem