android 开发程序员

用TabLayout 导design.jar包的引入

2017-06-11  本文已影响0人  靓亮
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>
上一篇下一篇

猜你喜欢

热点阅读