If you set a view's autoresizesSubviews
property to NO
, that view will not apply autoresizing to its subviews. You can do this in a xib or storyboard by unchecking the “Autoresizes Subviews” checkbox in the attributes inspector.
The correct place to programmatically lay out subviews is in the layoutSubviews
method of your custom UIView
subclass. Your view will receive the layoutSubviews
method whenever its size changes or when its subviews
array changes. You will receive it when the view is first being put on the screen, and inside the autorotation animation block.