My current tab bar looks like this:

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:
Normal tab: the tab title should be black, since this is only the image of the image should be black. The expected tab should look like this:

Selected tab: the tab title should be red, since this is only the image of the image should be red. The expected tab should look like this:

tab bar color : make all tabBar color more transparent with the same color
Can anyone help with this?
ios objective-c uitabbarcontroller uitabbar
Lasang
source share