I am trying to create a UITabBar that I will customize using the appearance API. I am stuck on trying to remove the title label from the UITabBarItem and resizing the image to make it centered. If you just delete the title text, there will be empty space below the image and the bottom of the bar.
Does anyone know how to make a UITabBarItem without a title?
Set the title to nil
and move the icon
self.tabBarItem = [[UITabBarItem alloc] initWithTitle:nil
image:[[UIImage imageNamed:@"icon_tabbar_inactive.png"]
imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]
selectedImage:[[UIImage imageNamed:@"icon_tabbar_active.png"]
imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]];
// Move the tabbar icon to the middle of tabbar
self.tabBarItem.imageInsets = UIEdgeInsetsMake(6.0, 0.0, -6.0, 0.0);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With