Reputation: 8969
I have the following code:
PNRProfileViewController *vc = [[PNRProfileViewController alloc] initWithNibName:@"PNRProfileViewController" bundle:nil];
vc.delegate = self;
self.profileVC_ = vc;
UINavigationController *controller = [[UINavigationController alloc] initWithRootViewController:self.profileVC_];
AHLog(@"FRAME IS %@", NSStringFromCGRect(self.profileVC_.view.frame));
controller.view.frame = self.profileVC_.view.frame;
controller.view.autoresizingMask = self.profileVC_.view.autoresizingMask;
self.currentViewController_ = controller;
when I run this code, the frame height I got changes every time.. it's alternating between 416 and 460. I have no idea why this is. Any clue?
Upvotes: 0
Views: 90
Reputation: 434
44 pixels is the height of the navigation bar.
To keep the navigation bar and have your nib respect its size, go into your .xib file, select the view, then on the attributes tab, set the tab bar drop down to navigation bar.
To remove the navigation bar, after you alloc your NavigationController call controller.navigationBarHidden = YES;
Upvotes: 1