I have 3 elements, imageview, label and a view. I want to maintain the eqaul space (15) for bottom view. Layout is as :
Imageview then label and at the bottom, there is a view. I have defined the top constraints of the view >=15 from the imageview, 84 from label but I want to push down the view when the label grows beyond the imgeview. Now what is happening the view is pushing down when the lable gets on new line and there is more than 15pt space between label and the bottom view which I don’t want.
Question posted in Xcode
Whether you're new to Xcode or an experienced developer, our archive has everything you need to know about this integrated development environment (IDE). From basic functionalities to advanced features, our archive covers a wide range of Xcode-related questions and answers. Browse our archive now and find solutions to your Xcode questions, and take your app development skills to the next level
Whether you're new to Xcode or an experienced developer, our archive has everything you need to know about this integrated development environment (IDE). From basic functionalities to advanced features, our archive covers a wide range of Xcode-related questions and answers. Browse our archive now and find solutions to your Xcode questions, and take your app development skills to the next level
2
Answers
Probably the easiest way is to put the image view and label in a horizontal stack view, with Alignment set to Top:
The stack view is constrained at 16-pts Top / Leading / Trailing, and 15-pts to the "blue view."
At run-time, with different amounts of text in the label: