My current tab bar looks as follows:
My code is as follows:
-(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;
}
What i want to do is:
Normal tab: title of tab should be black as it is but only icon image should be black. Expected tab should be like :
Selected tab: title of tab should be red as it is but only icon image should be red. Expected tab should be like :
tab bar color : make the whole tabBar color more transparent with same color
Can anyone help to do this?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…