I have a UIView
subclass (to deal with drag and drop) and with Interface Build I added two subviews: an UIImageView
and an UILabel
.
Both have constraints:
UIImageView
border match the superview borders in order to fill all the available space. UILabel
is centered vertical and horizontally.
Here you can see the three (superview background is green).
My problem comes when I animate a frame change in the superview. The superview seems fine, but its subviews go crazy.
Here you can see it (ignore the brown square, is from another view)
As you can see, subviews "fall" from the superview, despite I call updateConstraints
on every subview.
I know it is a bad practice to mix AutoLayout with setFrame, but is the only way I know to do it.
Thanks