在 ICS 中包含片段的本机 ActionBar 选项卡之间滑动

发布于 2024-12-28 02:04:06 字数 464 浏览 4 评论 0原文

是否有一种原生方式可以在包含片段(每个选项卡一个)的不同 ActionBar 选项卡(Honeycomb/ICS 原生选项卡)之间滑动/滑动?

我知道 Android 兼容性包,由 解决方案由 Google 自己提供。但我不想仅仅为了使用一种简单且非常常见的可用性模式而添加整个库。

即使是全新的 Android 设计指南 也提倡在 ActionBar 选项卡之间滑动,但没有提到了一种在蜂窝或冰淇淋三明治中本地实现的方法。

Is there a native way to swipe/fling between different ActionBar tabs (the Honeycomb/ICS native one) containing fragments (one per tab)?

I know of the Android Compatibility package, which is used by this solution provided by Google itself. But I don't want to add the whole library just to use one simple and very common usability pattern.

Even the brand new Android Design Guide advocated swiping between ActionBar tabs, but without mentioning a way to do it natively in Honeycomb or Ice Cream Sandwich.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

亚希 2025-01-04 02:04:06

是否有一种原生方法可以在包含片段(每个选项卡一个)的不同 ActionBar 选项卡(Honeycomb/ICS 原生选项卡)之间滑动/滑动?

如果“选项卡”指的是“选项卡”(即用户点击的东西),那么当操作系统允许时,选项卡将自动滑动。如果选项卡数量超出了操作栏中的空间,则用户可以来回滑动(正常尺寸的屏幕纵向),或者选项卡将转换为 Spinner 样式下拉列表(横向正常尺寸屏幕,或大/超大尺寸屏幕上的两个方向)。

如果“选项卡”指的是“选项卡内容”(即占据屏幕大部分的内容),则选项卡不可滑动,除非您自己处理(例如,ViewPager)。

Is there a native way to swipe/fling between different ActionBar tabs (the Honeycomb/ICS native one) containing fragments (one per tab)?

If by "tab" you mean "tab" (i.e., the thing the user taps on), then tabs will be swipe-able automatically by the OS when it lets you. If you have more tabs than there is room for in the action bar, either the user can swipe back and forth (normal-size screen in portrait), or the tabs will be converted into a Spinner-style drop-down list (normal-size screen in landscape, or both orientations on large/xlarge-size screens).

If by "tab" you mean "tab content" (i.e., the thing that takes up the bulk of the screen), then tabs are not swipeable unless you handle that yourself (e.g., ViewPager).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文