UITabBarController tabBar setItemWidth not working

I have six tabs and you need to show them without the "More" button. jomafer responds that setItemWidth does this. I called it in AppDelegate , but it did not work.

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

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

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

But there are few, for example this , that say that I cannot use UITabBar . It's true?

+7
ios xcode uitabbarcontroller uitabbar uitabbaritem
source share
1 answer

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

Do you really need 6 buttons at the bottom of the screen? They will be small goals. Think about rethinking your workflow if you have 6 buttons that you will need to constantly receive.

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

There is also an existing UITabBar replacement project called Infinite Tab Bar , which can suit your needs if you don’t necessarily need all 6 buttons visible at any time.

+6
source share

All Articles