0

I'm trying to make a custom UINavigationBar, but the problem is that my background image has a curve in it, and its little bit larger than default navigation bar. When I try to set background image and change navigation bar size, its just scales image as a rectangle. Any ideas?

Bar: navigation bar background

Drabuna
  • 1,225
  • 1
  • 14
  • 18
  • I haven't tried this but maybe you could make the navigation bar background transparent, and draw this image on the main UIWindow? – Mike M Jan 11 '13 at 16:19
  • possible duplicate of [Custom UINavigationBar Background](http://stackoverflow.com/questions/704558/custom-uinavigationbar-background) – t0mm13b Jan 12 '13 at 16:01

1 Answers1

1

Override

- (CGSize) sizeThatFits:(CGSize)size  {
  return CGSizeMake(custom_width, custom_height);
}

in order to return the size for your custom navigation bar.

Note that if you use a height that is not a multiple of 4, it will cause trouble if you hide and then show the navigation bar at any point (it gets shifted by 1 pixel from the top)

Ege Akpinar
  • 3,266
  • 1
  • 23
  • 29