Meine aktuellen Tab-Leiste sieht wie folgt zu ändern:wie tabBar Symbolfarbe in ios
Mein Code ist wie folgt:
-(void)startTabBar{
self.tabBarController = [[UITabBarController alloc] init];
TAB_1 *tab_1 = [[TAB_1 alloc]init];
TAB_2 *tab_2 = [[TAB_2 alloc]init];
TAB_3 *tab_3 = [[TAB_3 alloc]init];
[[UITabBarItem appearance] setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys: [UIColor blackColor], NSForegroundColorAttributeName, nil] forState:UIControlStateNormal];
[[UITabBarItem appearance] setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIColor redColor], NSForegroundColorAttributeName,nil] forState:UIControlStateSelected];
NSArray* controllers = [NSArray arrayWithObjects:tab_1,tab_2, tab_3, nil];
self.tabBarController.viewControllers = controllers;
self.window.rootViewController = self.tabBarController;
}
Was ich tun möchte, ist:
Normale Registerkarte: Titel der Registerkarte sollte schwarz wie es ist aber nur Icon-Bild sollte schwarz sein. Erwartete Tab sollte wie:
Ausgewählte Registerkarte: Titel Tab rot sein sollte, da es aber nur Symbolbild ist rot sein sollte. Erwartete Tab sollte wie:
Tableiste Farbe: die ganze tabBar Farbe transparenter zu machen mit der gleichen Farbe
Kann mir jemand helfen, dies zu tun?
Check diese Antwort http://stackoverflow.com/a/18742880/1679187 –
@YogeshSuthar Diese Antwort ist veraltet – michaelsnowden