self.view.frame.size in viewDidLoad and didRotateFromInterfaceOrientation are different

Posted by tokentoken on Stack Overflow See other posts from Stack Overflow or by tokentoken
Published on 2010-03-28T06:27:40Z Indexed on 2010/03/28 6:33 UTC
Read the original article Hit count: 824

Filed under:

I created iphone view-based project, and added UINavigationController by code.

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {    

TestViewController *vc = [[TestViewController alloc]init];
navController = [[UINavigationController alloc]initWithRootViewController:vc];
[window addSubview:navController.view];
[window makeKeyAndVisible];

return YES;

}

After that, I checked self.view.frame.size.height in viewDidLoad and didRotateFromInterfaceOrientation, and they're different. (they're 460 and 416)

I suppose the height of NavigationBar is not included in viewDidLoad, but should I add it manually (add 44)?

© Stack Overflow or respective owner

Related posts about iphone-sdk