用TabLayout 导design.jar包的引入

dependencies {
    ......
    compile 'com.android.support:design:25.0.0'
    ......
}

tabLayout和viewPager的布局文件的引入

<android.support.design.widget.TabLayout
    android:id="@+id/tabLayout"
    app:tabMode="scrollable"
    app:tabTextColor="@color/unselector_tab_text_color"
    app:tabSelectedTextColor="@color/selector_tab_text_color"
    app:tabIndicatorColor="@color/selector_tab_color"
    app:tabBackground="@color/colorPrimaryDark"
    android:layout_width="match_parent"
    android:layout_height="wrap_content">

</android.support.design.widget.TabLayout>
<android.support.v4.view.ViewPager
    android:id="@+id/vp_content"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

</android.support.v4.view.ViewPager>
    原文作者:靓亮
    原文地址: https://www.jianshu.com/p/0795b5363fc6
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞