0

I want to add a logo to the navigation bar on the first view controller, but it scales it badly because I don't know what the maximum size is. Does anyone know?

By the way, I know about the trick for creating full-sized images but I don't want to do that, I just want to utilise the built-in titleView property.

Thanks!

jowie
  • 8,028
  • 8
  • 55
  • 94

1 Answers1

1

In general, I think that the title view is adjusted to whatever space other views leave left and right. At least that is the behavior of the standard title view.

Have you tried to play with the contentMode property of your UIImageView (which I assume you put into the titleView)? If not, try

imageView.contentMode = UIViewContentModeScaleAspectFit;

and try out a suitable CGRect for the frame. If your image is just large enough for the smallest title view, it should work no matter how wide the title view gets.

Mundi
  • 79,884
  • 17
  • 117
  • 140
  • I get it now... Thanks! In fact, the reason I was having problems was because I'd forgotten to put the non-retina version of the titleView in there. Doh ;) – jowie Aug 08 '11 at 12:49