I am using a tab control in my application and want to use the default search icon on one of my tabs. I am making the tab bar programmatically, but I cannot find a property where I can specify the UITabBarSystemItemSearch element that I found in the Apple documentation. The following is my code for the tab bar
CouponsViewController *coupons = [[CouponsViewController alloc] init]; UINavigationController *couponsNavigationController = [[UINavigationController alloc] initWithRootViewController:coupons]; couponsNavigationController.tabBarItem.title = @"Coupons"; couponsNavigationController.navigationBar.tintColor = [UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:0.1]; [coupons release]; SettingsViewController *settings = [[SettingsViewController alloc] init]; UINavigationController *settingsNavigationController = [[UINavigationController alloc] initWithRootViewController:settings]; settingsNavigationController.tabBarItem.title = @"Settings"; settingsNavigationController.navigationBar.tintColor = [UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:0.1]; [settings release]; ProfileViewController *profile = [[ProfileViewController alloc] init]; UINavigationController *profileNavigationController = [[UINavigationController alloc] initWithRootViewController:profile]; profileNavigationController.tabBarItem.title = @"Profile"; profileNavigationController.tabBarItem.image = [UIImage imageNamed:@"profileImg.png"]; profileNavigationController.navigationBar.tintColor = [UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:0.1]; [profile release]; [tabBarController setViewControllers:[NSArray arrayWithObjects:loyaltyNavigationController,searchNavigationController,couponsNavigationController,settingsNavigationController,profileNavigationController,nil] animated:NO]; tabBarController.delegate=self; tabBarController.selectedIndex=0; [window addSubview:tabBarController.view];
source share