Skip to content

Instantly share code, notes, and snippets.

@irekasoft
Created April 6, 2014 17:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save irekasoft/10009289 to your computer and use it in GitHub Desktop.
Save irekasoft/10009289 to your computer and use it in GitHub Desktop.
Setup customized tab bar for ios 7
- (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