pagerslidingtabstripandroid-slidingandroid-elevation

Elevation on SlidingTabLayout in pre lollipop device


"Elevation" make Sliding Tab Layout worked fine on Lollipop device but tabs will disappeared on pre-lollipop device. I wondering is there any way to add elevation on SlidingTabLayout for pre-Lollipop devices.

Here is my .XML file :

<RelativeLayout
    android:id="@+id/tab_frame_layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_below="@+id/divider_line">

    <!-- Sliding Tab Layout -->
    <com.luulla.mobile.android.library.SlidingTabLayout
        android:id="@+id/tabs"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:elevation="1.5dp"
        android:background="#FFFFFF"/>

    <!-- Add ViewPager -->
    <android.support.v4.view.ViewPager
        android:id="@+id/pager"
        android:layout_height="match_parent"
        android:layout_width="match_parent"
        android:layout_below="@android:id/tabs">
    </android.support.v4.view.ViewPager>

</RelativeLayout>

Solution

  • I found solutions through here, replace "android=elevation=" with a drawable xml file.