3 Replies Latest reply: Jun 28, 2008 10:22 PM by casasims
djMaxM Level 1 Level 1
I want to display "longer text" in a UINavigationBar or UIToolbar. So I'd like to set the font on it. Is this possible?

MacBook Pro, Mac OS X (10.5.2)
  • casasims Level 1 Level 1
    I dont know of any way to set the font for the basic title but a possible work around would be to use the UIView alternative. The navbar allows you to subclass UIView and use this in place of the title. With the View you would be free in incorporate text of what ever font you like, you could even make it multiple lines of any color etc. The world is wide open as long as the view fits in bar frame.

    Hope this helps,
    Tom.
  • Brent Royal-Gordon Level 2 Level 2
    For that matter, I bet you could put a UILabel in there and set its adjustsFontSizeToFitWidth property to YES. No need to subclass UIView yourself!
  • casasims Level 1 Level 1
    Of course since UILabel extends UIView you could use that as well as any other component derived from UIView. my point was that he has the full pectrum of flexability afforded by using a view, not specifically UIView.