I want to align image view and label horizontally in container but they are aligning correctly
I want to make both leading edges together but it not showing correctly
and one more thing if a view present there below label and if text is less or more than it should display just below the label height
view should adjusted according to variant height of label
Assuming that your layout looks something like this, at the top there is a image, below that there is a label whose leading should be equal to the top image view leading. And below the label there should be another view whose top space should vary according to the label height.
Solution for this goes like this, For the top image view pin image view to top of its superview with some space as per your requirements and centre it horizontally. For the label pin it to image view bottom and label top with some space as per your requirements. Also add constraint to leading of label to leading of top image view and trailing of label to trailing of image view as 0 points. For the view below the label pin label bottom to view top with some space as per your requirements. Then add leading and trailing constraints with respect to top image view similar to the constraints added to the label trailing and leading.