3

I have a six UITabBarItem in a UITabBarController.

I want to disable the NavigationBar that auto-generates the tab number 5, which allows you to reorder the tabs as you want.

Is there a way to disable this function?

EXTRA

I use customtabbar but in the tab5 appears this navigationbar. the tab6 for me must be "hidden"

2 Answers2

3

there is the property customizableViewControllers

from the docs: "Changing the value of the viewControllers property (either directly or using the setViewControllers:animated: method) also changes the value of this property. When first assigned to the tab bar controller, all view controllers are customizable by default."

so call myTabBarController.customizableViewControllers = nil to remove customization

Daij-Djan
  • 49,552
  • 17
  • 113
  • 135
1

It looks like you are using a UITabBarController.

You can only have up to 5 tab bar items without bringing up the additional item to customize the bar items. If you don't want the extra tab to allow for customization, your 6th item will be unreachable anyway, so just remove the last tab to make it 5 items.

From the UITabBarController Documentation:

The tab bar has limited space for displaying your custom items. If you add six or more custom view controllers to a tab bar controller, the tab bar controller displays only the first four items plus the standard More item on the tab bar. Tapping the More item brings up a standard interface for selecting the remaining items.

If you do not like this limitation, use a UITabBar directly. There is more work involved because you won't be using a UITabBarController which manages the view controllers of your tabs for you.

Kekoa
  • 27,892
  • 14
  • 72
  • 91