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?
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.
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