views:

19

answers:

1

In a view Controller I am adding a UINavigationController and it has around 20-30 pixels on top of it. It doesnt fit the navigationCOntroller properly. For soem reason it adds the subview 20-30 px below

navController = [[UINavigationController alloc] init];
navController.navigationBar.tintColor = [UIColor grayColor];
UnitViewController *unitController = [[UnitViewController alloc] init];
[navController pushViewController:unitController animated:YES];
[self.view addSubview:navController.view];

Any Idea?

A: 

If this is a full screen app then perhaps the UnitViewController's view is not setup correctly. It may be assuming presence of status bar and leaving room for it.

jamihash
that did teh trick
self.view.bounds = CGRectMake(0.0, 20.0, self.view.frame.size.width, self.view.frame.size.height);