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/

相关文章:

android - 从数组中引用字符串数组 res id

android - 如何在 Android XML 中创建固定高度的垂直线?

android - 隐藏 View 默认构造函数

kotlin - 为什么流程不执行,没有引发错误?

java - 我可以在 Android 上使用循环来处理多个作品吗?

JavaFX TabPane 重新排序错误,正在寻找解决方法

java - 如何使按钮在释放后仍保持选中状态?

java - 推土机映射类级别是可访问的

android - 在android中的 ListView 上列出mysql的结果

android - 如何访问存储在 kotlin block 中的变量中的值