是否存在“溢出”? Android 3.0+ 的视图动作栏?
我的 ActionBar 上有许多选项卡,我想找到一种方法来在平板电脑进入纵向模式时处理这些选项卡。目前,如果您有超过 3-4 个以及任何显示的菜单项,则更多选项卡将被切断且不可用。我想知道是否有办法让这些自动溢出到“更多”选项卡中。或者,如果有一种方法可以将物理选项卡和额外选项的下拉列表作为最后一个“选项卡”。有人遇到过这种情况吗?
I have a number of tabs on the ActionBar and I want to find a way to handle those when the tablet is put into portrait mode. Currently, if you have more than 3-4 and any showing menu items, any more tabs will be cut off and unavailable. I'm wondering if there's a way to have those overflow into a "more" tab automatically. Or, if there's a way to have physical tabs and a drop down list for extra options as the last "tab". Has anyone encountered this scenario yet?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果我正在开发需要具有大量选项卡的用例的应用程序,我会执行以下操作之一:
onConfigurationChanged
以检测何时处于纵向模式并隐藏选项卡上的文本,仅留下图标。使用 主题 您还可以调整选项卡的填充内容。I would do one of the following if I were developing the app that required a use case with a high count of tabs:
onConfigurationChanged
to detect when in portrait mode and hide the text on the tabs leaving only the icon. Using themes you can also adjust the padding of the tab contents.onConfigurationChanged
to detect when in portrait mode and switch the navigation be list-based. This will provide you with more room for action items while still showing the current "tab" that the user is on.来自 http://developer.android.com/sdk/android-4.0.html#操作栏
。
From http://developer.android.com/sdk/android-4.0.html#ActionBar
Yay!