iphone - iOS unable to autoresize subviews when device rotation -
i tried several solutions found on other posts still having problems autoresize subviews when device rotation. layout (ib) has 3 views , apply resize current view. if then, after rotating device, view shown, not resized , remains @ previous dimensions. set autoresize subviews , mask... doing wrong or missing? 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 given view adjust size upon device rotation, superview needs have autoresizessubviews property set yes. (it not clear code fragment view hierarchy is.) try changing
[vistab setautoresizessubviews:yes]; to
[vistab.superview setautoresizessubviews:yes];
Comments
Post a Comment