PDA

View Full Version : Image at Navigation bar




jorgmart
Mar 2, 2009, 06:11 PM
Hello,

Im new in Iphone developing, my english is not very good, excuse me in advance.

Im trying to create a interface using a UINavigationController with 2 UIViewControllers. The root controller must have a custom image covering the whole area of the navigation bar, but when the 2nd controller is pushed, the classical navigation bar is displayed. Something like is shown in the "USA Today" app.

I've tried with the titleView property of the "navigationItem" but this is not an option because it not cover the whole area of the navigation bar ... just the title, and some gaps left unfilled.

My current option is to do all the navigation by myself. This is, to create my first view with my banner then show my second view with an animation. Of course I need to manage all the stuff regarding pushing and poping views.

Is there an easy way to achieve this?

Thanks in advance.

Jorge



dejo
Mar 2, 2009, 06:27 PM
Rather than trying to redo all the smarts of the UINavigationController, I'd suggest subclassing it and then overriding it as necessary to show your custom image background. This is one of the advantages of object-oriented programming and you should take advantage of it when you can.

P.S. Your English is very good!

jorgmart
Mar 3, 2009, 08:40 AM
Thank you dejo,

Subclassing Navigation Controller? I will try that ...

Regards!