I am in the process of making some changes to the application, including the transition to a navigation-based interface. As part of this change, I wrote a view controller containing UINavigationController. The problem is that for some strange reason UINavigationBarand UIToolbaroperated UINavigationController, are shifted by 20 pixels down from the point where they should be. I was able to create the following example demonstrating the problem:
@implementation MyAppDelegate
@synthesize window = _window;
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window.frame = [[UIScreen mainScreen] applicationFrame];
[self.window makeKeyAndVisible];
TestController* tc = [TestController new];
[self.window addSubview:tc.view];
return YES;
}
@end
@implementation TestController
- (void)loadView
{
self.view = [[UIView alloc] initWithFrame:CGRectZero];
UINavigationController* navController = [UINavigationController new];
navController.view.backgroundColor = [UIColor blueColor];
[navController setToolbarHidden:NO animated:NO];
[self.view addSubview:navController.view];
}
@end
This gives the following result on my machine:

, 20 , . , ( wantsFullScreenLayout, autoresizesSubviews ..) . ( , ), . - , 20 ( ).
!
EDIT: , self.window.frame = [[UIScreen mainScreen] applicationFrame]; , . , ( ). , , , ?