So I wanted to add a UIViewController with width 450 and height of the screen, so if it’s portrait then the height is 1024 and if it’s landscape then the height is 768. This view controller, called ProfileViewController has a xib that is set at 450 and 1024. Auto-resize is set to have flexible height.
profViewController = [[ProfileViewController alloc] initWithNibName:@"ProfileViewController" bundle:nil];
self.profileViewController_ = profViewController;
[profViewController release];
So inside ProfileViewController I am also initializing another view controller called FeedsViewController. Now the issue is that in profViewController viewDidLoad’s the height is always set to 1024 no matter what the orientation is. How do I have this so that it adjusts to what my orientation is? I’ve tried setting the bounds of profViewController but then this change is reflected after the viewDidLoad.
If you set the
FeedsViewControllerview’s frame in the same manner that you’ve set theProfileViewControllerview’s frame in the NIB, then things should automatically resize correctly. That is, you give it an initial size that’s what you want relative to the outer view, then let the system’s auto-resize behaviour take things from there.Try something like this inside
ProfileViewController‘sviewDidLoad: