简体   繁体   English

Android:如何在选项卡选择上禁用默认的Pop TabLayout动画

[英]Android: how to disable default pop TabLayout animation on tab selection

So, is there a way to disable animation when a tab is selected? 那么,有没有一种方法可以在选择选项卡时禁用动画? I'd like to remove shadow/elevation. 我想删除阴影/高程。 The idea is to keep it simple. 想法是保持简单。

在此处输入图片说明

Here is my layout app bar code: 这是我的布局应用程序条形码:

<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>

Any help will be appreciated. 任何帮助将不胜感激。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Android:如何查找选项卡布局中哪个选项卡处于活动状态? - Android: How to find which tab is active in a tablayout? 如何更改TabLayout的滑动制表带动画持续时间? - How to change sliding tab strip animation duration for TabLayout? 如何检测 android TabLayout 中的选项卡焦点变化? - How can I detect tab focus changes in an android TabLayout? Android:如何将自定义字体应用于 TabLayout 中的活动选项卡? - Android: How can I apply a custom font to an active tab in TabLayout? 如何在 webview android java 中禁用 cookie 弹出? 有什么方法可以阻止这个弹出窗口或在后台默认接受 cookie - how to disable cookie pop up in webview android java? is there any way to block this pop up or accept cookie by default in background TabLayout选项卡选择不会更改选项卡内容 - TabLayout tab selection doesn't change the tab content 如何用tablayout制作比例制表符? - How make proportional tab with tablayout? TabLayout:如何从第二个选项卡开始? - TabLayout: How to start with the second tab? Android TabLayout使用listfragment向上滚动动画 - Android TabLayout scroll up animation with listfragment Android从TabLayout中的Tab移除阴影 - Android remove Shadow from Tab in TabLayout
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM