java - Android:如何禁用选项卡选择时的默认弹出 TabLayout 动画

标签 java android kotlin android-animation android-tablayout

那么,有没有办法在选择选项卡时禁用动画?我想删除阴影/高程。我们的想法是保持简单。

enter image description here

这是我的布局应用程序条形码:

<android.support.design.widget.AppBarLayout
    android:id="@+id/appbar2"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="@color/colorWhite"
    app:elevation="0dp"
    app:layout_constraintBottom_toBottomOf="parent"
    app:layout_constraintEnd_toEndOf="parent"
    app:layout_constraintStart_toStartOf="parent">

    <android.support.design.widget.TabLayout
        android:id="@+id/tabs"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@color/colorWhite"
        app:tabIndicatorColor="@android:color/transparent"
        app:tabIndicatorHeight="0dp">

        <android.support.design.widget.TabItem
            android:id="@+id/tabItem0"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout="@layout/tab_translator"
            android:icon="@drawable/ic_translator"/>

        <android.support.design.widget.TabItem
            android:id="@+id/tabItem1"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout="@layout/tab_history"
            android:icon="@drawable/ic_history"/>

        <android.support.design.widget.TabItem
            android:id="@+id/tabItem2"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout="@layout/tab_dialog"
            android:icon="@drawable/ic_dialog"/>

    </android.support.design.widget.TabLayout>

</android.support.design.widget.AppBarLayout>

任何帮助将不胜感激。

最佳答案

在您的 TabLayout 中添加可以使用的 app:tabBackground="@color/white"

关于java - Android:如何禁用选项卡选择时的默认弹出 TabLayout 动画,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51080086/

相关文章:

java - 使用表格在 Libgdx 中绘制重叠图像

java - 在java中导入Dll库

java - 如何在单元测试中测试异步操作内的方法调用

java - 我如何使用 git 在 Intellij 中管理 workspace.xml

Android 应用内结算 SecurityException "Binder invocation to an incorrect interface"

Android studio 4.0 新更新版本说 Kotlin 与这个新版本不兼容

java - 当结果是一条记录时,Hibernate Search/Lucene 返回 null 元素

java - Android 套接字接收问题

android - Jetpack Compose 中复选框中的透明复选标记

java - 从 JSONArray 获取元素时保留双引号