I tried several solutions found on other posts but still having problems to autoresize subviews when device rotation. My layout (IB) has three views and only apply resize to current view. If then, after rotating device, view is shown, was not resized and remains at previous dimensions. I set autoresize subviews and its mask… What am I doing wrong or missing? any help would be appreciated, thank you!
- (void)viewDidLoad
{
[super viewDidLoad];
[self.view setAutoresizesSubviews:YES];
[self.view setAutoresizingMask:UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight];
[vistaSocial setAutoresizesSubviews:YES];
[vistaSocial setAutoresizingMask:UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight];
[vistaB setAutoresizesSubviews:YES];
[vistaB setAutoresizingMask:UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight];
For a given view to adjust its size upon device rotation, it is its superview that needs to have its
autoresizesSubviewsproperty set toYES. (It is not clear from your code fragment what your view hierarchy is.) Try changingto