Frage

Ich habe diesen Code in meinem AppDelegate in hinzugefügt didFinishLaunchingWithOptions Methode:

[[UINavigationBar appearance]setBackgroundColor:[UIColor colorWithRed:221/256.0 green:36/256.0 blue:40/256.0 alpha:0.0]];

[[UITabBar appearance] setBackgroundColor:[UIColor colorWithRed:221/256.0 green:36/256.0 blue:40/256.0 alpha:0.0]];

Aber die Navigationsleiste und die Tabbar änderten ihre Farbe nicht. Was habe ich falsch gemacht? Vielen Dank

War es hilfreich?

Lösung

Verwenden setTintColor: Anstelle von SetbackgroundColor:

[[UINavigationBar appearance] setTintColor:[UIColor colorWithRed:221/256.0 green:36/256.0 blue:40/256.0 alpha:0.0]];
[[UITabBar appearance] setTintColor:[UIColor colorWithRed:221/256.0 green:36/256.0 blue:40/256.0 alpha:0.0]];
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top