[英]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.