views:

25

answers:

3

Basically I want a custom UINavigationBar. I don't want it to be "translucent" or anything, like the pictures app.

I basically want to completely remove it, but I still want to be able to add back buttons and such when navigation controllers are pushed, and I want the views (EG: UITableViewController) to be pushed down below it.

Like this:

alt text

Any ideas how to achieve this at all?

Thanks

A: 

Hard to tell, could be the UINavigationBar is there and color matches the UIView background or, there is no UINavigationBar, just a view with custom buttons and UILabel on top. Pick an approach and code it, or ask the question again with more specifics.

Jordan
I don't know how to specify more. I want a see-through navigation bar. Am I just going to have to create my own navigation bar style element? In which case - how do I know if I'm on the root view controller? If I'm not on the root view controller I can just add a "back" button to the view can't I?
Thomas Clayson
A: 

To see through the UINavigation Bar, if you choose to have one, just:

self.navigationController.navigationBar.translucent=YES;

You'll have to change the tint/color to match the background if you want it to appear like the image you posted.

Jordan
That just makes it semi-transparent... its ok, I found another way of doing it... see my answer
Thomas Clayson
A: 
@implementation UINavigationBar (background)

- (void)drawRect:(CGRect)rect {
    UIImage *image = [UIImage imageNamed:@"navigationbar.png"];
    [image drawInRect:CGRectMake(0, 0, self.frame.size.width, self.frame.size.height)];
}

@end

basically, its not completely see through - its a visual lie. The only way to do it realistically is to override UINavigationBar's drawRect: method, as shown above.

Thomas Clayson