如何在选项卡视图中滚动选项卡

发布于 2024-09-25 19:38:49 字数 82 浏览 2 评论 0原文

我在选项卡视图中使用六个选项卡。在纵向模式下,选项卡尺寸变得非常小。所以我想水平滚动选项卡,以便每个选项卡的大小保持原始大小。我们怎样才能做到这一点?

I am using six tabs in tab view. In portrait mode tab size become very small .So i want to scroll the tabs in horizontal so that size of each tab will remain original . How we can do this?

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

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

发布评论

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

评论(2

洋洋洒洒 2024-10-02 19:38:49

网上有很多解决方案,但它们都很复杂而且没有必要。如果您尝试使屏幕顶部的选项卡可滚动,那么您可以使用我在下面显示的这个简单的实现。希望这有帮助。

<HorizontalScrollView android:layout_width="fill_parent"
  android:layout_height="wrap_content"
  android:fillViewport="true"
  android:scrollbars="none">

      <TabWidget
        android:id="@android:id/tabs"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content" />

</HorizontalScrollView>

There are a lot of solutions on the web for this but they're all complicated and unnecessary. If you are trying to make the tabs on the top of the screen scroll-able then you can use this simple implementation I have shown below. Hope this helps.

<HorizontalScrollView android:layout_width="fill_parent"
  android:layout_height="wrap_content"
  android:fillViewport="true"
  android:scrollbars="none">

      <TabWidget
        android:id="@android:id/tabs"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content" />

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