Skip to content

Instantly share code, notes, and snippets.

@YvesBill
Created March 8, 2017 09:57
Show Gist options
  • Save YvesBill/980eddf83a80936bb4a4eb19fd94764f to your computer and use it in GitHub Desktop.
Save YvesBill/980eddf83a80936bb4a4eb19fd94764f to your computer and use it in GitHub Desktop.
Layout for ViewPager+TabLayout
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="#fafafa"
android:id="@+id/coordinatorLayout">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.design.widget.TabLayout
android:id="@+id/tabs"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:tabMode="fixed"
app:tabGravity="fill"
android:background="@color/colorPrimary"
style="@style/TabLayout"/>
<android.support.v4.view.ViewPager
android:id="@+id/viewPager"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/tabs"/>
</RelativeLayout>
</android.support.design.widget.CoordinatorLayout>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment