Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialMichael Arsenault
15,352 PointsDepecated in iOS7
Trying to get white unselected tab bar icons, following the video, does not work. Looking around, I keep finding that:
"setFinishedSelectedImage:withFinishedUnselectedImage is deprecated in iOS7"
So what is the workaround?
I've found
[[UIView appearanceWhenContainedIn:[UITabBar class], nil] setTintColor:[UIColor whiteColor]];
in AppDelegate.m works on launch, but once you switch tabs, any previously visited tab reverts back to its grey appearance.
2 Answers
jboro
2,670 PointsAssuming you used the same names for the variables (tabInbox, tabFriends, tabCamera), try this:
//set icon tint color to original color
[tabInbox setImage:[[UIImage imageNamed:@"inbox"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]];
[tabFriends setImage:[[UIImage imageNamed:@"friends"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]];
[tabCamera setImage:[[UIImage imageNamed:@"camera"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]];
Michael Arsenault
15,352 PointsThat did it! Much thanks!