john_yourspace
asked on
UITabBar color
Hi guys,
I am trying to set the selected and unselected color for my UITabBar icons and text,
My code doesn't seem to be working what is the best solution, I have the following in the appdelegate
Note: the only thing thats not working is the unselected state.
I am trying to set the selected and unselected color for my UITabBar icons and text,
My code doesn't seem to be working what is the best solution, I have the following in the appdelegate
Note: the only thing thats not working is the unselected state.
UIImage *tabBarBackground = [UIImage imageNamed:@"TabBar.png"];
[[UITabBar appearance] setBackgroundImage:tabBarBackground];
[[UITabBar appearance] setTintColor:[UIColor blackColor]];
[[UITabBar appearance] setSelectedImageTintColor:[UIColor blackColor]];
[[UIView appearanceWhenContainedIn:[UITabBar class], nil] setTintColor:[UIColor redColor]];
[[UITabBar appearance] setSelectedImageTintColor:[UIColor greenColor]];
Did you try TabBar delegate functions ? e.g., didSelectItem ? Change the image for all button and then selected image of the button that tapped ?
ASKER
Do you have some sample code to try
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.