Created
April 6, 2014 17:47
-
-
Save irekasoft/10009289 to your computer and use it in GitHub Desktop.
Setup customized tab bar for ios 7
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)setupTabBar | |
{ | |
// Assign tab bar item with titles | |
UITabBarController *tabBarController = (UITabBarController *)self.window.rootViewController; | |
UITabBar *tabBar = tabBarController.tabBar; | |
UITabBarItem *tabBarItem1 = tabBar.items[0]; | |
UITabBarItem *tabBarItem2 = tabBar.items[1]; | |
UITabBarItem *tabBarItem3 = tabBar.items[2]; | |
UITabBarItem *tabBarItem4 = tabBar.items[3]; | |
// GUIDES | |
[tabBarItem1 setImage:[UIImage imageNamed:@"guides"]]; | |
[tabBarItem1 setSelectedImage:[UIImage imageNamed:@"guides-sel"]]; | |
// EXPLORE | |
[tabBarItem2 setImage:[UIImage imageNamed:@"explorer"]]; | |
[tabBarItem2 setSelectedImage:[UIImage imageNamed:@"explorer-sel"]]; | |
// MY PLAN | |
// tabBarItem3.badgeValue = @"12"; | |
[tabBarItem3 setImage:[UIImage imageNamed:@"my-plan"]]; | |
[tabBarItem3 setSelectedImage:[UIImage imageNamed:@"my-plan-sel"]]; | |
// MY PLAN | |
[tabBarItem4 setImage:[UIImage imageNamed:@"personalGuide"]]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment