I got a Franciso code working with a few minor tricks. I put the code in the application didFinishLaunchingWithOptions method of the standard Tab Bar application template in Xcode 4.1. I believe Xcode 4.2 may have a different template.
UIImage *buttonImage = [UIImage imageNamed:@"tabItemOff.png"]; UIImage *highlightImage = [UIImage imageNamed:@"tabItemSelected.png"]; UIButton* button = [UIButton buttonWithType:UIButtonTypeCustom]; button.frame = CGRectMake(0.0, 0.0, buttonImage.size.width, buttonImage.size.height); [button setBackgroundImage:buttonImage forState:UIControlStateNormal]; [button setBackgroundImage:highlightImage forState:UIControlStateHighlighted]; CGFloat heightDifference = buttonImage.size.height - self.tabBarController.tabBar.frame.size.height; if (heightDifference < 0) button.center = self.tabBarController.tabBar.center; else { CGPoint center = self.tabBarController.tabBar.center; center.y = center.y - heightDifference/2.0; button.center = center; } [self.tabBarController.view addSubview:button];
source share