I'm wanting to create a custom tab bar design with only 3 buttons.
The issue comes when trying to split the images to fit on the iPhones screen. With the width being 320, you need 2 tabs to be 106 wide and the 3rd to be 108.
When I create the images at the right size, they don't fit and I end up with a 1px line down the right hand side like this:
This is the code I'm using:
UIImage *selectedImage0 = [UIImage imageNamed:@"tb_1_down.png"];
UIImage *unselectedImage0 = [UIImage imageNamed:@"tb_1_up.png"];
UIImage *selectedImage1 = [UIImage imageNamed:@"tb_2_down.png"];
UIImage *unselectedImage1 = [UIImage imageNamed:@"tb_2_up.png"];
UIImage *selectedImage2 = [UIImage imageNamed:@"tb_3_down.png"];
UIImage *unselectedImage2 = [UIImage imageNamed:@"tb_3_up.png"];
UITabBar *tabBar = self.tabBarController.tabBar;
UITabBarItem *item0 = [tabBar.items objectAtIndex:0];
UITabBarItem *item1 = [tabBar.items objectAtIndex:1];
UITabBarItem *item2 = [tabBar.items objectAtIndex:2];
self.tabBarController.tabBar.frame = CGRectMake(0, 430, 320, 50);
[self.tabBarController.tabBar setBackgroundImage:[UIImage imageNamed:@"tb_tabBar_BG.png"]];
[item0 setFinishedSelectedImage:selectedImage0 withFinishedUnselectedImage:unselectedImage0];
[item1 setFinishedSelectedImage:selectedImage1 withFinishedUnselectedImage:unselectedImage1];
[item2 setFinishedSelectedImage:selectedImage2 withFinishedUnselectedImage:unselectedImage2];
Is there any way to make 'item1' 108 wide instead of 106?!