1

I have the follow TextView tag in my Activity layout

<TextView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:elevation="25dp"
        android:text="TEST TEST TEST"
        android:padding="15dp"
        android:layout_margin="120dp"
        android:translationZ="5dp"
        android:background="#FFFFFF" />

The shadow from the elevation is appearing in Android Studio's render of the activity, but when I run the app on my KitKat phone (Galaxy S4), the shadow is nonexistent. Is this a common problem?

DonutGaz
  • 1,422
  • 2
  • 17
  • 23

2 Answers2

6

The elevation property is only supported on Android 5.0+. android:elevation will be ignored on older devices.

CommonsWare
  • 954,112
  • 185
  • 2,315
  • 2,367
0

Since your device does not support elevation, you can add your own drop shadows to your textview. Take a look at https://stackoverflow.com/a/10373264/4739608 , this should help.

Community
  • 1
  • 1
Errol Green
  • 1,347
  • 5
  • 18
  • 32