Reputation: 1567
My UITabBarItems aren't showing up vertically centered in my UITabBar. I am using a custom sized background image for my UITabBar.
UITabBarController *tabController = [[UITabBarController alloc] init];
UITabBar *tabBar = [controller tabBar];
UIImage *backgroundImage = [UIImage imageNamed:@"Images/bottomBar.png"];
[tabBar setBackgroundImage:backgroundImage];
SplashScreenController *introController = [[SplashScreenController alloc] init];
UIImage *introImage = [UIImage imageNamed:@"Images/navIntro.png"];
UITabBarItem *introItem = [[UITabBarItem alloc] initWithTitle:@"Intro" image:introImage tag:0];
[introController setTabBarItem:introItem];
NSMutableArray *controllers = [[NSMutableArray alloc] init];
[controllers addObject:introController];
NSArray *controllers = [self createControllers];
[tabController setViewControllers:controllers];
Upvotes: 0
Views: 265
Reputation: 23
It looks like you are missing the retina version of your files, such as a 60x60 [email protected]
. The [email protected]
file needs to be in your project, but in code you would still reference the file as navIntro.png
.
Upvotes: 1