views:

857

answers:

2

I've read plenty of requests about a full-on custom UINavigationBar background, but what I want is to overlay a logo on the default UINavigationBar instead of text. Preferably, I'd like to apply it to a subclass of UINavigationBar called CustomNavigationBar.

Thanks in advance.

A: 

This page has some code you can look at as he explains how to do some custom things to the nav controller. http://foobarpig.com/iphone/uinavigationbar-with-solid-color-or-image-background.html

Here is another reference as well. http://www.developers-life.com/custom-uinavigationbar-with-image-and-back-button.html

Shadow
Both of those are exactly what I said was unneeded - a full custom UINavigationBar background. I just need to somehow override the text drawn on the UINavigationBar with an image. Thanks for the suggestion though.
Zachary Hinchliffe
Ah darn sorry, hopefully someone can use the code.
Shadow
+5  A: 

Neat tricks, Shadow.

If you just want to add a logo instead of a title, that's easy. Set the titleView on your navigationItem, like so:

UIImageView *imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"Logo"]];
self.navigationItem.titleView = imageView;
[imageView release];
Paul Lynch
Oh clever, that is pretty nice. Much easier than what I had :)
Shadow
+2!!!!!!! An elegant solution, with **correct memory management!!!!!!!!!!!!**. My, I wish memory management could be easier....
jrtc27