我正在创建一个使用选项卡布局的应用程序。该应用程序的要求是需要有许多选项卡。在选项卡栏中放置4-5个选项卡还好,但当添加了超过5个选项卡时,它会变得非常压缩。在Android中是否有一种方法可以拥有许多选项卡而不使其看起来被压缩?也许像在选项卡上有一个“更多”按钮或具有水平滚动选项卡之类的方式?我忘记之前提到这一点了,它应该在Android 2.2(API 8)上工作。谢谢。
app:tabMode="scrollable"
<android.support.design.widget.TabLayout
android:id="@+id/tabs"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:tabMode="scrollable"
app:tabTextColor="@color/colorWhite"
app:tabSelectedTextColor="@color/colorSecondary"
android:background="@color/colorPrimary"
app:tabIndicatorColor="@color/colorSecondary"
app:tabIndicatorHeight="5dp"/>
</android.support.design.widget.AppBarLayout>