views:

1102

answers:

1

Im using a typical situation with UINavigationController, id like to make the navigation bar a bit taller. setting its bounds and frame dont seem to make a difference, im using this code

    //set up the navigation
UINavigationController *navigationController = [UINavigationController new];

[navigationController.navigationBar setBarStyle:UIBarStyleBlack];
[navigationController.navigationBar setTintColor:[UIColor purpleColor]];
[navigationController.navigationBar setBounds:CGRectMake(0.0, 0.0, 480.0, 100.0)];
[navigationController.navigationBar setFrame:CGRectMake(0.0, 0.0, 480.0, 100.0)];

but to no avail. any ideas?

p.s. im always confused about bounds and frame, i keep forgetting which is which.

+1  A: 

I don't think you can change the height of a navigation bar. Except when you add a prompt message... But that's not what you want.

Frame is the visible area of a view. B ounds is the internal area. Usually this has an origin of (0, 0) and is as wide and high as the frame. However, when te content exceeds the visible area (like with a UIScrollView) the bounds can be larger (and the origin different). You rarely see bounds that are smaller than their respective frames.

EDIT: Looking at your code, what is [UINavigationController new] about? You should do [[UINavigationController alloc] init], shouldn't you?

Also, what you are doing is not really subclassing...

Jongsma
you're right, its not subclassing, thinking about other things while writing the question. as for the 'new', must have copied the code from somewhere
Aran Mulholland