Question

J'ajouté ce code dans mon AppDelegate de méthode didFinishLaunchingWithOptions:

[[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]];

Mais NavigationBar et TabBar n'a pas changé leur couleur. Ce que je fait de mal? Merci

Était-ce utile?

La solution

Utilisation setTintColor: au lieu de 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]];
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top