iPhone Development Uncategorized

Quick Tip: Adding icons to Three20 Tab Bar

I’m using the Three20 Additions to UITabBarController for the Green Ninja Active City Guide iPhone app (based on TTNavigatorDemo). This is great, except all the examples I found for tab bar images use the controller to set the tab bar item. With Three20, that didn’t work, so I had to add some code to my TabBarController to get icons.

In the code below, the first part of the method sets up the tab bar for three URLs/controllers, and the second part of the method adds the images.

Has anyone else used a different approach to get icons on a Three20 application tab bar?

- (void)viewDidLoad {

[super viewDidLoad];

[self setTabURLs:[NSArray arrayWithObjects:





NSArray *tabs =  [self viewControllers];

UIViewController *home = [tabs objectAtIndex:0];

home.tabBarItem.image = [UIImage imageNamed:@"house.png"];

UIViewController *activities = [tabs objectAtIndex:1];

activities.tabBarItem.image = [UIImage imageNamed:@"star.png"];

UIViewController *map = [tabs objectAtIndex:2];

map.tabBarItem.image = [UIImage imageNamed:@"world.png"];


Leave a Reply

Your email address will not be published. Required fields are marked *