Why doesn't my height in the root view take the navigation bar into account?

I had the impression that the UINavigationController navigation bar would always discard the height of the child view, so that the origin of the child view was at the bottom of the title bar.

But when I present a view controller like this ...

MyViewController *viewController = [[MyViewController alloc] init];
UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:viewController];
viewController.title = @"My View Controller";
viewController.navigationItem.prompt = @"My Prompt";
viewController.delegate = self;

[self presentModalViewController:navigationController animated:YES];
[navigationController release]; [viewController release];

... and then check self.view.frame.size.heighton NSLog in viewDidLoad, it reports that my view is 460 pixels high. Shouldn't he subtract the height of my name and clue?

+5
source share
2 answers

So, according to the request:

viewDidLoad, . , , ( 320x480 iPhone-).

. , viewWillAppear, . , iPhone-. iPad-, , !

- , NIB.

+18

, self . self MyViewController, , , 460-44 ( UIToolbar), self (, ), (, 460px).

, self.view.frame.size.height MyViewController, . ( viewWillAppear:), .

self.view.frame.size.height viewDidLoad, , , .

, .

+3

All Articles