views:

642

answers:

1

Is there a straightforward way of overriding the titleView of the current navigation bar item in a navigation bar within a navigation controller? I've tried creating a new UIView and replacing the titleView property of topView with my own UIVIew with no success.

Basically, I want a multi-line title for the navigation bar title. Any suggestions?

+1  A: 

Set the titleView in your view controller class, then you should be able to see your custom view in the 'title' area of the navigation controller. Remember the titleView property is ignored if leftBarButtonItem is not nil.

http://developer.apple.com/iphone/library/featuredarticles/ViewControllerPGforiPhoneOS/NavigationControllers/NavigationControllers.html#//apple_ref/doc/uid/TP40007457-CH103-SW3

petert