views:

61

answers:

2

In my applicationDidFinishLaunching I set up a UINavigationController:

- (void)applicationDidFinishLaunching:(UIApplication *)application { 
    navController = [[UINavigationController alloc] init];
    [[navController navigationBar] setFrame:CGRectMake(0.0,0.0,320.0,20.0)];
...
}

As you can see, I am trying to make the navigation controller's height 20px. However, this is not working. I would imagine setFrame must be the correct function but I am not calling it in the right place. I realize that other questions on SO are similar to mine, but I think setting the navigationBar height should be possible if it responds to setFrame...right?

Also, anyone know the default height of the navigationBar?

Thanks!

+1  A: 

Default height is 44 pixels for navigationbar. If you want to change it, try adding a category to UINavigationBar and override setFrame: method.

EEE
+2  A: 

The default height of the navigation bar is 44px.

I am not sure you should be attempting to directly resize the navigation bar, the documentation certainly discourages it:

When used in conjunction with a navigation controller, there are only a handful of direct customizations you can make to the navigation bar. Specifically, it is alright to modify the barStyle, tintColor, and translucent properties of this class, but you must never directly change UIView-level properties such as the frame, bounds, alpha, or hidden properties directly.

Depending on what you are trying to do it may be easier to place a new UIView over/below the navigation bar.

kharrison