tvOS 的 UITabBarController 中视图控制器的最大数量是多少
What is the maximum number of view controllers in UITabBarController for tvOS
tvOS 的 UITabBarController 中视图控制器的最大数量是多少? developer.apple.com.
上没有记录
屏幕明显比 iOS 设备大。我知道 iOS 如果数字大于 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
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.
我是在 StoryBoard 中添加 ViewController 找到的。不管你的按钮多小,答案都是7。超过7ViewController就会隐藏。当然没有“更多”按钮。我添加了一个 8 视图控制器,但它只显示 7 (七).
答案是 7
太好了,对吧?!
解决方案
可悲的是,我自己写了 TabBarController :(
它不是 UITabBarController 的子类,而是 UIViewController。希望 Apple 会改变这一点(他们不会。)。应该取决于按钮的大小,并且可以自动计算每个具体情况。
最佳。
tvOS 的 UITabBarController 中视图控制器的最大数量是多少? developer.apple.com.
上没有记录屏幕明显比 iOS 设备大。我知道 iOS 如果数字大于 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
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.
我是在 StoryBoard 中添加 ViewController 找到的。不管你的按钮多小,答案都是7。超过7ViewController就会隐藏。当然没有“更多”按钮。我添加了一个 8 视图控制器,但它只显示 7 (七).
答案是 7
太好了,对吧?!
解决方案
可悲的是,我自己写了 TabBarController :( 它不是 UITabBarController 的子类,而是 UIViewController。希望 Apple 会改变这一点(他们不会。)。应该取决于按钮的大小,并且可以自动计算每个具体情况。
最佳。