1

I know this is probably something very basic but I can't, for the life of me, figure out how to do it. I've searched around but haven't seen any solution that works.

I have set up a UITabbar using Storyboard and I have it set up to use custom images (the tab bar items are set up as "Custom" in the storyboard). I am not setting any title for the tab bar items.

The image appears raised and there is still the space reserved for the title. The image is 30x30 (and 60x60 for retina, named info.png and info@2x.png respectively).

Things I have tried

[[UITabBarItem appearance] setTitlePositionAdjustment:UIOffsetMake(0.0, -50.0)]; 
// to make the title go off the tabbar. Have also tried other offsets less and greater than -50.

That does move the title but the image stays in the same place. Next I tried

UITabBarItem * tabItem5 = [self.tabBar.items objectAtIndex: 4];
[tabItem5 setTitle:nil];

Neither of those solutions worked. I don't want to programmatically declare the UITabbar. There has to be a way of doing this for UITabbars declared using storyboard / IB.

Help will be appreciated, Thanks!

Predator
  • 469
  • 2
  • 6
  • 20

1 Answers1

1

It seems that there isn't a way to do this currently. The "best" (though not really a good option for me) turned out to be using a custom class that someone else has written.

Some such classes I came across

https://github.com/briancollins/BCTabBarController

https://github.com/davidmorford/TabBarKit

https://github.com/boctor/idev-recipes/tree/master/TabBarAnimation

For my needs though, I've decided to keep the tabbaritem text for now.

Predator
  • 469
  • 2
  • 6
  • 20