I have to do this:
1:CGRect originalSubviewFrame = subview.frame;
2:view.frame = (CGRect)newFrame;
3:subview.frame = originalSubviewFrame;
I think instructions 1 and 3 shouldn’t be there but if I don’t restore the subview shape, it change for some reason!?!?
I read the documentation but it’s unclear.
If
subviewis a subview ofviewthen whether it’s frame changes whenview‘s frame changed depends on whetherview.autoresizesSubviewsisYESand if so, how that manifests is determined bysubview.autoresizingMask.I encourage you to read the
UIViewdocumentation regarding those two properties.