7

I have six tabs and need to show them all without More button.jomafer answer says that setItemWidth does that. I called this in AppDelegate but it didn't work.

[[UITabBar appearance] setItemWidth:self.window.frame.size.width/6];  

I then called the above in TabBarController viewDidLoad but it still didn't work.
Even tried

[self.tabBar setItemWidth:self.window.frame.size.width/6]; 

But there are few like this which say that what I want is not possible using UITabBar. Is this true?

Community
  • 1
  • 1
Nitish
  • 13,845
  • 28
  • 135
  • 263
  • Yes this is true that you can not add more than 5 tabs in UITabBar. If there are more than 5 tab then the tab bar automatically add "more" for extra tabs. From where you can access the rest tabs. – V.J. May 21 '15 at 11:37

1 Answers1

6

UITabBar does not support more than 5 items without the "more" button.

Do you really need 6 buttons at the bottom of the screen? They're going to be small targets. Consider rethinking your workflow if you have 6 buttons you'll need to constantly access.

If you definitely need 6, just subclass UITabBar - I'm pretty sure you just need to override layoutSubviews and change a 5 to a 6 somewhere.

There's also an existing UITabBar replacement project called Infinite Tab Bar that might fit your needs, if you don't necessarily need all 6 buttons visible at all times.

Ari Lotter
  • 605
  • 8
  • 23