Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>It does look like an Apple bug, and you should enter a bug on it with bug reporter. That said, I can give you a relatively painless workaround: add this code to your RecipetTableViewController:</p> <pre><code>- (void)viewDidLoad { [super viewDidLoad]; self.title = @"Recipe Book"; UIBarButtonItem *it = [[UIBarButtonItem alloc] initWithTitle:self.title style:UIBarButtonItemStylePlain target:nil action:NULL]; UIImage * btBack_30 = [[UIImage imageNamed:@"btBack_30"] resizableImageWithCapInsets:UIEdgeInsetsMake(0, 13, 0, 5)]; [it setBackButtonBackgroundImage:btBack_30 forState:UIControlStateNormal barMetrics:UIBarMetricsDefault]; self.navigationItem.backBarButtonItem = it; } </code></pre> <p>EDIT: You can dup this bug if interested, the more bugs referencing it the more likely apple will fix it:</p> <blockquote> <p>BUG: 15506447 </p> <p>State:OpenProduct:iOS</p> <p>19-Nov-2013 03:53 PM</p> <p>Summary: Setting the UIBarButtonItem appearance proxy for the back bar button item does not have any affect until the second appearance of the button.</p> <p>Steps to Reproduce: In appDelegate, before anything has appeared, add these statements:</p> <p>UIImage * gradientImage44 = [[UIImage imageNamed:@"navBar_44"] resizableImageWithCapInsets:UIEdgeInsetsMake(0, 0, 0, 0)]; UIImage * gradientImage32 = [[UIImage imageNamed:@"navBar_32"] resizableImageWithCapInsets:UIEdgeInsetsMake(0, 0, 0, 0)]; // Set the background image for <em>all</em> UINavigationBars [[UINavigationBar appearance] setBackgroundImage:gradientImage44 forBarMetrics:UIBarMetricsDefault]; [[UINavigationBar appearance] setBackgroundImage:gradientImage32 forBarMetrics:UIBarMetricsLandscapePhone];</p> <p>Expected Results: When a viewController is first pushed, its back button has the image in it.</p> <p>Actual Results: First time it appears, there is no image. Push the view again and its there. Actually it does appear when you click on the button the very first time, but not when the button first appears.</p> <p>Version: Xcode 5.0.1, iOS 7.0.3</p> <p>Notes: Adding this in the root view controller of the navigation controller makes it work:</p> <ul> <li><p>(void)viewDidLoad { [super viewDidLoad];</p> <p>self.title = @"Recipe Book"; UIBarButtonItem *it = [[UIBarButtonItem alloc] initWithTitle:self.title style:UIBarButtonItemStylePlain target:nil action:NULL]; UIImage * btBack_30 = [[UIImage imageNamed:@"btBack_30"] resizableImageWithCapInsets:UIEdgeInsetsMake(0, 13, 0, 5)]; [it setBackButtonBackgroundImage:btBack_30 forState:UIControlStateNormal barMetrics:UIBarMetricsDefault]; self.navigationItem.backBarButtonItem = it; }</p></li> </ul> <p>Attached demo project shows the problem.</p> <p>Configuration:</p> <p>Attachments: 'DynamicsCatalog.zip' was successfully uploaded.</p> </blockquote> <p>EDIT: I'm happy to say that again, entering bugs in bug reporter, does sometimes work!</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload