UINavigationBar - Einstellung hintergrund Bild?

Also ich habe eine Kategorie für UINavigationController und ich überschreiben Sie die init-Methode wie folgt

- (id)initWithFrame:(CGRect)frame
{
    if (self = [super initWithFrame:frame])
    {
            UIImage *image = [UIImage imageNamed:@"navBar.png"];
            [[UINavigationBar appearance] setBackgroundImage:image forBarMetrics:UIBarMetricsDefault];      
    }

        return self;
}

Folgende code bewirkt, dass das Hintergrundbild der Navigationsleiste zu leer (weiß).
Die Bild-name korrekt ist, und es existiert innerhalb des Projekts. Eine Idee, was dieses problem verursacht?

InformationsquelleAutor aryaxt | 2012-02-16
Schreibe einen Kommentar