2

I'm porting my UI to iOS7. One of the problems I found is that the default back button with customized background doesn't show the background, but only title after pushing the new controller to UINavigationViewController. The background shows once I hit the back button and then shows all next times I move back and forth between the controllers. Does anybody know how to resolve it?

Thanks!

UPDATE - adding image: after first push: enter image description here

after click and push again:

enter image description here

Note - the arrow is a custom stretchetable image, that is set by using:

[[UIBarButtonItem appearanceWhenContainedIn:[MyNavigationController class], nil] setBackButtonBackgroundImage:[[UIImage imageNamed:@"navigationBarButtons_back"] stretchableImageWithLeftCapWidth:17 topCapHeight:0.0] forState:UIControlStateNormal barMetrics:UIBarMetricsDefault];
[[UIBarButtonItem appearanceWhenContainedIn:[MyNavigationController class], nil] setBackButtonBackgroundImage:[[UIImage imageNamed:@"navigationBarButtons_backPress"] stretchableImageWithLeftCapWidth:17 topCapHeight:0.0] forState:UIControlStateHighlighted barMetrics:UIBarMetricsDefault];
Nava Carmon
  • 4,523
  • 3
  • 40
  • 74
  • It would be great if you put image. – Toseef Khilji Dec 19 '13 at 13:55
  • did you try by putting that code in the app delegate? – Shabir jan Dec 19 '13 at 15:34
  • It is there already, also pay attention, that the customization is on appearance, not on the specific instance of UIBarButtonItem – Nava Carmon Dec 19 '13 at 17:59
  • See [iOS 7 custom back button](http://stackoverflow.com/questions/18824887/ios-7-custom-back-button). One option is to ditch the background images (which is more iOS7-ish anyways), or there is a patch at that link which you could use to fix it. – Carl Lindberg Dec 29 '13 at 06:59
  • 1
    this is a duplicate of http://stackoverflow.com/questions/20009879/uibarbuttonitem-appearance-trouble-in-ios-7-could-this-be-an-apple-bug?rq=1. Apparently there is a bug, that was filled for Apple for this problem – Nava Carmon Jan 09 '14 at 07:38

0 Answers0