0

I have a tablayout with viewpager in a fragment. Now I want to set bottom shadow to the tablayout. I searched regarding this and tried using android:elevation value but it doesn't show any shadow to the tablayout. I also setting android:clipChildren="false" and android:clipToPadding="false" and margin bottom value. Am I doing something wrong here? Any help would be appreciated.

Mario
  • 145
  • 2
  • 16
  • Possible duplicate of [How to add bottom shadow to tab layout](https://stackoverflow.com/questions/34675791/how-to-add-bottom-shadow-to-tab-layout) – crazo7924 Jul 18 '19 at 17:03

2 Answers2

0

If your minimum api version is 21 or more then use below

android:elevation="6dp"
Hardik Bambhania
  • 1,732
  • 15
  • 25
0

if it's from code you can use:

ViewCompat.setElevation(yourView,elevationFloat)
Igor Siqueira
  • 397
  • 3
  • 7