How to set a UINavigation size to fit the size of the background image?

advertisements

I've set my UINavigationBar background image to some image, like this:

UINavigationBar *navBar = self.navigationController.navigationBar;
UIImage *image = [UIImage imageNamed:@"Menubar.png"];
[navBar setBackgroundImage:image forBarMetrics:UIBarMetricsDefault];

but I cant really see the whole image since its bigger than the default size on a UINavigationBar.

So two things please:

  1. How to set a UINavigation size to fit the background image size?
  2. I dont want to see the battery and time bar in the background, so my image will cover it.

  1. It's not possible to set UINavigation size (take a look at this question), you have to fit the background image instead
  2. It's impossible to cover the status bar, but you can easily hide it. See the example here