gpt4 book ai didi

uitabbar - tvOS 的 UITabBarController 中 View Controller 的最大数量是多少

转载 作者:行者123 更新时间:2023-12-04 11:27:35 27 4
gpt4 key购买 nike

tvOS 的 UITabBarController 中 View Controller 的最大数量是多少?它没有记录在 developer.apple.com 上.
屏幕明显比iOS设备大。我知道对于 iOS,如果数字大于 5,它会添加一个“更多”按钮。

The More Navigation Controller The tab bar has limited space fordisplaying your custom items. If you add six or more custom viewcontrollers to a tab bar controller, the tab bar controller displaysonly the first four items plus the standard More item on the tab bar.Tapping the More item brings up a standard interface for selecting theremaining items. The interface for the standard More item includes anEdit button that allows the user to reconfigure the tab bar. Bydefault, the user is allowed to rearrange all items on the tab bar. Ifyou do not want the user to modify some items, though, you can removethe appropriate view controllers from the array in thecustomizableViewControllers property.


笔记

Tab bar customization andthe More interface is not available in tvOS


tvOS 的差异

Tab bar controllers serve the same purpose in tvOS as in iOS, butprovide slightly different user interface features: The tab barinterface appears at the top of the window. When focus leaves the tabbar, the tab bar is hidden. Swiping up on the remote shows the tab baragain and focuses it. A user can also show and focus the tab bar bypressing the Menu button. Swiping down from the tab bar moves focusinto the content view; specifically, to the first focusable view thatis visually below the selected tab. Swiping down behaves like a normalfocus-changing gesture—that is, focus moves in the direction the userswiped. If nothing is focusable immediately below the selected tab,the closest focusable view is focused instead. Pressing the Selectbutton while a tab is focused moves focus into the content view.Because there is no direction associated with this change, focus movesto the view specified in the content view's preferredFocusedViewproperty. Tab bar controllers in tvOS do not support customization. Atab bar controller displays only the number of view controllers fromits viewControllers array that fit on the screen, and does not providethe More interface seen in iOS.

最佳答案

我通过在 StoryBoard 中添加 ViewControllers 找到了它。不管你的按钮有多小,答案都是 7。如果超过 就会隐藏。 7 View Controller 。当然没有“更多”按钮。我添加了一个 8 查看 Controller ,但它只显示 7(七) .
答案是 7
很棒,对吧?!
解决方案
遗憾的是,我编写了自己的 TabBarController :(
这不是 UITabBarController 的子类,而是 UIViewController .希望苹果会改变这一点(他们不会。)。应该取决于按钮的大小,并且可以自动计算每个特定情况。
最好的事物。

关于uitabbar - tvOS 的 UITabBarController 中 View Controller 的最大数量是多少,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47186946/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com