如何减少 iPad 上显示的标签栏项目数量
我有一个拆分视图控制器 iPad 应用程序。它是 iPhone 版本的移植,严重依赖标签栏。由于您不能将拆分视图控制器放入选项卡栏中(或者至少不应该,或者我读过),因此我选择了一种设计,其中选项卡栏控制器位于拆分视图控制器的详细视图控制器内部。
这很好用。然而,选项卡栏显示 8 个选项卡,而不是像 iPhone 上那样显示 5 个选项卡。这使得标签栏极其狭窄。
我知道在 iPhone 上 4+more 是无法更改的。有谁知道是否有办法让iPad在标签栏上只显示4个图标或5个图标?
I have a split View Controller iPad app. Its a port of a iPhone version that relied heavily on the tab bar. Since you cannot put a split view controller into a tab bar (or at least shouldn't, or so I've read) I settled on a design where the tabbar controller is inside the detail view controller of the split view controller.
This works fine. However, the tabbar is showing 8 tabs rather than 5 like on the iPhone. This makes for an incredibly cramped tab bar.
I know on the iPhone the 4+more is unchangable. Does anyone know if there's a way to make the iPad only show 4 icons or 5 icons on the tabbar?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我以前也想要过同样的事情。但是,UITabBarController 不提供控制显示选项卡数量的方法。
我建议使用导航控制器而不是标签栏。在左侧使用外观相似的漂亮图标,基于导航的界面与分割视图界面非常相配。
如果选项卡栏确实是您想要的,您可以在进入横向模式时删除一些选项卡,然后添加自定义的“更多”选项卡。您可以在那里使用基于导航的表格视图来显示已删除的项目。甚至可以实现 UITabBarController 的“更多”视图的“编辑”功能,但我认为这不值得付出努力。
I've had wanted the same thing before. However, UITabBarController does not provide a way to control the number of tabs shown.
I would suggest using a navigation controller instead of the tab bar. Using similar-looking pretty icons at the left, a navigation-based interface goes well with the split view interface.
If the tab bar is really what you want, you may remove some of the tabs when it goes to the landscape mode, and add a custom 'more' tab instead. You can have a navigation-based table view there to show the removed items. It is even possible to implement 'edit' feature of UITabBarController's 'More' view, but I think it wouldn't be worth the effort.