樣品的Gif:如何使移動動畫TabLayout
我要讓TabLayout移動動畫效果相同樣本GIF。在此示例中,TabLayout包含兩個選項卡(收入,費用)。在右側或左側滑動它會改變它們的背景顏色。我怎樣才能做到這一點。
我已成功使ViewPager與TabLayout。我不知道做這種類型的動畫。請幫助。
TabLayout:
<android.support.design.widget.TabLayout
android:id="@+id/tab_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/colorPrimary"
android:minHeight="?attr/actionBarSize"
app:tabIndicatorColor="@color/white"
app:tabBackground="@color/colorPrimary"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" />
我會說你不需要TabLayout來實現這種效果。也許一個切換按鈕,並沒有左/右滑動會做的伎倆。 – user3641702
這樣的例子嗎? – Zohaib