How do I change background color of UITabItem when item is selected

user2290869 picture user2290869 · Jul 26, 2013 · Viewed 29.1k times · Source

I would like a different background color when the user selects a tab bar item than when it is unselected.

Answer

user1898829 picture user1898829 · Aug 2, 2013

Put this in the Appdelegate.m in application didFinishLaunchingWithOptions

UIImage *whiteBackground = [UIImage imageNamed:@"whiteBackground"];
[[UITabBar appearance] setSelectionIndicatorImage:whiteBackground];