Adding a custom selected UITabBarItem image in iOS7
It's a little tricky to have the new UITabBarItem filled-in image style shown in the current iOS7 apps.
Xcode Storyboard doesn't provide you with a field to add a highlighted image in the Attributes inspector. So you will need to use the following code inside your AppDelegate.m : didFinishLaunchingWithOption.
UITabBarController *tabBarController = (UITabBarController *)self.window.rootViewController; UITabBar *tabBar = tabBarController.tabBar; UITabBarItem *tabBarItem1 = [tabBar.items objectAtIndex:0]; UITabBarItem *tabBarItem2 = [tabBar.items objectAtIndex:1]; UITabBarItem *tabBarItem3 = [tabBar.items objectAtIndex:2]; UITabBarItem *tabBarItem4 = [tabBar.items objectAtIndex:3]; tabBarItem1.selectedImage = [UIImage imageNamed:@"iconActionSelected"]; tabBarItem2.selectedImage = [UIImage imageNamed:@"iconEmotionSelected"]; tabBarItem3.selectedImage = [UIImage imageNamed:@"iconHereIAmSelected"]; tabBarItem4.selectedImage = [UIImage imageNamed:@"iconJumboSelected"]; return YES;
To learn how to design custom bar icons, see Bar Button Icons.
















