jpardogo / PagerSlidingTabStrip

An interactive indicator to navigate between the different pages of a ViewPager
2.19k stars 353 forks source link

Can I add shadow to PagerSlidingTabStrip ? #46

Closed rampatra closed 9 years ago

rampatra commented 9 years ago

I want some elevation/shadow for PagerSlidingTabStrip as in Google Play app and Contacts app in Android Lollipop.

Is it possible, if yes how?

jpardogo commented 9 years ago

PagerSlidingTabStrip is a View like any other so you can use [setElevation](http://developer.android.com/reference/android/support/v4/view/ViewCompat.html#setElevation%28android.view.View, float%29)

Notice that ViewCompat. setElevation is only apply in API21 and it won't be apply to API's below it. It won't crash either. If you want to apply a shadow in API's below 21 you have to go for a view with gradient and add it to you layout hierarchy.