iOS 7 UINavigationBar appearance nicht funktioniert ersten mal...

Ich versuche, ändern Sie das Aussehen der UINavigationBar in meinem iOS7 app. Ich Tue das folgende:

- (void)viewDidLoad
{
    [super viewDidLoad];

    m_sNumberToCall = @"";

    UIBarButtonItem * btn = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"IconHome.png"] style:UIBarButtonItemStyleBordered target:self action:@selector(btHomeTouched:)];
    self.navigationItem.leftBarButtonItem = btn;

    self.navigationController.navigationBar.translucent = YES;


    [[UINavigationBar appearance] setBackgroundImage:[UIImage imageNamed:@"TVCNavBack.png"] forBarMetrics:UIBarMetricsDefault];

    NSShadow * shadow = [[NSShadow alloc] init];
    shadow.shadowColor = [UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:0.8];
    shadow.shadowOffset = CGSizeMake(0, 1);
    [[UINavigationBar appearance] setTitleTextAttributes: [NSDictionary dictionaryWithObjectsAndKeys:
                                                           [UIColor colorWithRed:245.0/255.0 green:245.0/255.0 blue:245.0/255.0 alpha:1.0],
                                                           NSForegroundColorAttributeName,
                                                           shadow,
                                                           NSShadowAttributeName,
                                                           [UIFont fontWithName:@"Helvetica-Bold" size:21.0],
                                                           NSFontAttributeName,
                                                           nil]];
}

Aber, als ich das erste mal präsentieren Sie die UITableViewController-es ist das standard-iOS7-nav-bar, dann drücke ich home und präsentieren Sie es wieder und es ist mein neuer look.

Irgendwelche Ideen, warum es nicht funktioniert, das erste mal?

InformationsquelleAutor der Frage LilMoke | 2013-11-14

Schreibe einen Kommentar