How to make outlined Tablayout with round corners?

41 Views Asked by At

I'm trying to make Tablayout with style like in screenshot. enter image description here

I made xml file in drawable:

<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle">
    <stroke
        android:width="2dp"
        android:color="@color/black" />
    <corners android:radius="10dp" />
</shape>

And added background to Tablayout:

<com.google.android.material.tabs.TabLayout
        android:id="@+id/tabLayout"
        android:layout_width="200dp"
        android:layout_height="wrap_content"
        android:layout_marginHorizontal="10dp"
        android:layout_marginTop="16dp"
        style="@style/CustomTabStyle"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/show"
        android:background="@drawable/tab_layout_background"
        >

But it doesn't work.

0

There are 0 best solutions below