I was told how to set images in general for the uitabbarcontroller. however, my uitabbarcontroller is an array of views that looks like this:
tabBarController = [[UITabBarController alloc] init]; viewTab1controller = [[ViewTab1Controller alloc] initWithNibName:@"ViewTab1" bundle:nil]; viewTab1controller.title = @"Schedules"; navigationTab1Controller = [[[UINavigationController alloc] initWithRootViewController:viewTab1controller] autorelease]; [viewTab1controller release]; viewTab2controller = [[ViewTab2Controller alloc] initWithNibName:@"ViewTab2" bundle:nil]; viewTab2controller.title = @"Nearest Stop"; navigationTab2Controller = [[[UINavigationController alloc] initWithRootViewController:viewTab2controller] autorelease]; [viewTab2controller release]; viewTab3controller = [[ViewTab3Controller alloc] initWithNibName:@"ViewTab3" bundle:nil]; viewTab3controller.title = @"Routes"; navigationTab3Controller = [[[UINavigationController alloc] initWithRootViewController:viewTab3controller] autorelease]; [viewTab3controller release]; viewTab4controller = [[ViewTab4Controller alloc] initWithNibName:@"ViewTab4" bundle:nil]; viewTab4controller.title = @"Feedback"; navigationTab4Controller = [[[UINavigationController alloc] initWithRootViewController:viewTab4controller] autorelease]; [viewTab4controller release];
I was provided with the code in the previous answer to add an image to tabbaritem:
viewController.tabBarItem.image = [UIImage imageNamed:@"foo.png"];
However, this does not indicate a specific tabbbaritem.
How to assign an image to each of these 4 tabs?
Thanks! zero];
source share