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,492
  • 2
  • 17
  • 24

2 Answers2

6

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

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
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,367
  • 5
  • 19
  • 32