github地址 https://github.com/ogaclejapan/SmartTabLayout
为什么要用这个 可定制性高 使用灵活
1.引入
implementation 'com.ogaclejapan.smarttablayout:library:1.7.0@aar'
2.布局文件使用
<com.ogaclejapan.smarttablayout.SmartTabLayout
android:id="@+id/tabs"
android:layout_width="match_parent"
android:layout_height="42dp"
android:layout_gravity="center_horizontal"
android:background="@color/colorWhite"
app:stl_indicatorColor="@color/home_color_fault"
app:stl_indicatorWidth="56dp"
app:stl_indicatorCornerRadius="1.5dp"
app:stl_indicatorThickness="3dp"
app:stl_indicatorInFront="true"
app:stl_dividerThickness="1dp"
app:stl_dividerColor="@color/home_color_line"
app:stl_customTabTextLayoutId="@layout/tab_layout"
app:stl_customTabTextViewId="@+id/id_tv_title"
app:stl_distributeEvenly="true"
app:stl_underlineThickness="0dp" />
各属性介绍