课堂笔记
- 调整 TabLayout 和 ViewPager 的属性
<com.google.android.material.tabs.TabLayout
android:id="@+id/home_indicator"
android:layout_width="match_parent"
android:layout_height="30dp"
app:tabBackground="@color/colorPrimary"
app:tabIndicatorColor="@color/colorTabSelected"
app:tabMode="scrollable"
app:tabRippleColor="@color/colorTabNormal"
app:tabSelectedTextColor="@color/colorTabSelected"
app:tabTextColor="@color/colorTabNormal" />
<androidx.viewpager.widget.ViewPager
android:id="@+id/home_pager"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:overScrollMode="never" />
<color name="colorTabSelected">#ffffff</color>
<color name="colorTabNormal">#aaffffff</color>