views:

38

answers:

1

I have seen it done on some apps, where the navigation bar is actually smaller than the default 44px, and there is a UIView (which has functionality) above the nav bar...

I want more than a custom background image, which I did manage to figure out how to do, but I dont know where to start getting something like this done.

Any help is greatly appreciated :) Mark

A: 

I found a sort of way to do this:

UINavigationBar *navBar = [[UINavigationBar alloc] initWithFrame: CGRectMake(0.0f, 20.0f, 320.0f, 32.0f)];

UIView *tempView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 20)];
UIImageView *back = [[UIImageView alloc] initWithImage: [UIImage imageNamed:@"logo.png"]];
[back setFrame: CGRectMake(0, 0, 320, 20)];
[tempView addSubview: back];
[[self view] addSubview: tempView];

[[self view] addSubview: navBar];

UINavigationItem *navItem = [[UINavigationItem alloc] initWithTitle: @"Controls"];
[navBar pushNavigationItem:navItem animated:NO];

which seems to do the trick, although I cannot seem to figure out how to get this 'into' the navigationController so that back buttons work, at the moment I have to manually insert a leftBarButtonItem into the navItem, the back button never seems to show...

Mark