Adding a line below TabLayout

In your Drawable folder create an xml

background.xml

<layer-list xmlns:android="http://schemas.android.com/apk/res/android">

    <item android:top="-10dp" android:right="-10dp" android:left="-10dp">
        <shape 
            android:shape="rectangle">
            <solid android:color="#1bd4f6" />
            <stroke
                android:width="2dp"
                android:color="#0288D1" />
        </shape>
    </item>

</layer-list>

Set this to your TabLayout

  <android.support.design.widget.TabLayout
        android:background="@drawable/background"
        android:id="@+id/tabs"
        android:layout_width="match_parent"
        android:layout_height="60dp"
        app:tabIndicatorColor="@color/colorAccent"
        app:tabTextColor="@color/white"/>

Change values and colors as you need!

Output:

enter image description here


You can try this. The solution

<FrameLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content">

    <android.support.design.widget.TabLayout
       android:id="@+id/tabs"
       android:layout_width="match_parent"
       android:layout_height="60dp"
       app:tabBackground="@color/white"
       app:tabIndicatorColor="@color/colorAccent"
       app:tabIndicatorHeight="2.5dp"
       app:tabTextColor="@color/white"/>

    <View
       android:layout_width="match_parent"
       android:layout_height="2.5dp"
       android:layout_gravity="bottom"
       android:background="#c6c6c6" />

</FrameLayout>