0
votes

Having some more issues with AutoLayout!!

Extra padding is being inserted to the left and right of my two ImageViews as you can see below. My constraints look fine.

For the ImageViews, the top one has: top space to superview = 8, leading space to superview = 8, bottom space to other imageview = 8, trailing spaces to the 3 labels = 8, align leading to other imageview.

The bottom ImageView has: bottom space to superview = 8, leading space to superview = 8, top space to other imageview = 8, trailing spaces to the 3 labels = 8, align leading to other imageview.

What is creating this extra padding?

enter image description hereenter image description here

1
can you post your storyboard structure? - Kathiravan G

1 Answers

1
votes

You need to show the constraints on the labels to confirm, but it looks to me like you've got a constraint pinning the labels to the trailing edge as well, and the image view is being stretched to satisfy all the constraints.

You either need the trailing constraint on the labels to be an inequality (e.g <= 8) or you need to set the image view to have higher horizontal content hugging priority than the labels.