0

Another day, another issue wrangling with iOS 7. I'm currently converting my companies legacy up to the latest and greatest and I'm running into all sorts of issues.

I'm currently trying to texture the status bar and for the most part it works as expected. The problem is that it does not cover the entire navigation bar, just the title area. I have the view controller contained within a navigation controller and I'm texturing the status bar like so:

UIImage * navBackground = [UIImage imageNamed:@"navigation-bar-background_iPhone.png"];
navBackground = [navBackground stretchableImageWithLeftCapWidth:0 topCapHeight:0];
[self.navigationController.navigationBar setBackgroundImage:navBackground forBarPosition:UIBarPositionTopAttached barMetrics:UIBarMetricsDefault];

This is what I am getting in return:

enter image description here

A key thing of interest is the black space above the nav bar as the page content is all white.

The background image that I'm using is 64 pixels tall. This is an older project so I'm not using autolayout and all the UI elements are contained in XIBs.Any help is appreciated.

  • What OS are you targeting as the base level? If you're building only for iOS 7 then you can switch to using an Asset Catalog and then embed the resizable information into the images themselves. Also, `stretchableImage...` is deprecated. You should use `resizableImageWith...`. – Fogmeister Oct 01 '13 at 13:40
  • Unfortunately, we're supporting all the way to iOS 5, but that does like a nice feature of iOS 7. Thanks for the heads up about the deprecated method. – Brian Douglas Moakley Oct 01 '13 at 13:56
  • Try to set the statusbar in ios7 to white. [It should work in ios7](http://stackoverflow.com/questions/17678881/how-to-change-status-bar-text-color-in-ios-7/18952134#18952134) – Pradeep Mahdevu Oct 01 '13 at 18:19

0 Answers0