Remove shadow from Tablayout API 21

Asked

Viewed 171 times

1

I want to remove the shadow of TabLayout, but in API 21 nothing is working.

I tried to define windowContentOverlay or the elevation for null and nothing works.

The rendered screen looks like this:

Tabs layout shadow

And my code is like this:

<android.support.design.widget.CoordinatorLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <android.support.design.widget.AppBarLayout
        android:layout_height="wrap_content"
        style="@style/tabs"
        android:layout_width="match_parent">

    <android.support.design.widget.TabLayout
        android:id="@+id/tabs"
        android:layout_width="match_parent"
        style="@style/tabs"
        android:layout_height="wrap_content"
        app:layout_scrollFlags="scroll|enterAlways"/>

    </android.support.design.widget.AppBarLayout>

    <android.support.v4.view.ViewPager
        android:id="@+id/viewpager"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:layout_behavior="@string/appbar_scrolling_view_behavior" />

</android.support.design.widget.CoordinatorLayout>

Can someone help me?

1 answer

0

Do this on Activity onCreate

TabLayout tabs = (TabLayout)findViewById(R.id.tabs);
tabs.setElevation(0);

Browser other questions tagged

You are not signed in. Login or sign up in order to post.