What is the maximum number of view controllers in UITabBarController for tvOS? It's not documented on developer.apple.com.
The screen is obviously bigger than iOS devices. I know for iOS it will add a "More" button if the number is bigger than 5.
The More Navigation Controller 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. The interface for the standard More item includes an Edit button that allows the user to reconfigure the tab bar. By default, the user is allowed to rearrange all items on the tab bar. If you do not want the user to modify some items, though, you can remove the appropriate view controllers from the array in the customizableViewControllers property.
Tab bar customization and the More interface is not available in tvOS
Tab bar controllers serve the same purpose in tvOS as in iOS, but provide slightly different user interface features: The tab bar interface appears at the top of the window. When focus leaves the tab bar, the tab bar is hidden. Swiping up on the remote shows the tab bar again and focuses it. A user can also show and focus the tab bar by pressing the Menu button. Swiping down from the tab bar moves focus into the content view; specifically, to the first focusable view that is visually below the selected tab. Swiping down behaves like a normal focus-changing gesture—that is, focus moves in the direction the user swiped. If nothing is focusable immediately below the selected tab, the closest focusable view is focused instead. Pressing the Select button while a tab is focused moves focus into the content view. Because there is no direction associated with this change, focus moves to the view specified in the content view's preferredFocusedView property. Tab bar controllers in tvOS do not support customization. A tab bar controller displays only the number of view controllers from its viewControllers array that fit on the screen, and does not provide the More interface seen in iOS.
I found it by adding ViewControllers in StoryBoard. No matter how smaller your buttons are, the answer is 7. It will hide if it's more than 7 ViewController. And no "More" button of course. I added an 8 view controller but it only shows 7 (seven).
Great, right?!
Sadly, I wrote my own TabBarController :( Which is not a subclass of UITabBarController but UIViewController. Hoping Apple will change this (they'll not.). Should be depending on the size of the buttons, and could auto calculate each specific case.
Best.
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