0

I've been trying to add shadow effect beneath my TextView, but for some reason, it's not working! The layout XML is given below. Can anyone please help find out the reason for that?

<TextView
    android:id="@+id/textView1"
    android:text="Hello World!"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentBottom="true"
    android:layout_alignParentLeft="true"
    android:layout_alignParentRight="true"
    android:layout_alignParentTop="true"
    android:background="@drawable/myshape"
    android:shadowColor="#ff0000"  
    android:shadowRadius="3"  
    android:shadowDx="2"  
    android:shadowDy="2"
    android:gravity="center"
    android:textAppearance="?android:attr/textAppearanceMedium" />

myShape Drawable:

    <?xml version="1.0" encoding="utf-8"?>
<shape 
    xmlns:android="http://schemas.android.com/apk/res/android" >
    android:shape=["rectangle"] >
  <stroke
    android:width="2dp"
    android:color="#FFFFFFFF" />
  <gradient
    android:endColor="#DDBBBBBB"
    android:startColor="#DD777777"
    android:angle="90" />
  <corners
    android:bottomRightRadius="15dp"
    android:bottomLeftRadius="15dp"
    android:topLeftRadius="15dp"
    android:topRightRadius="15dp" />

</shape>

The layout generated so far:

Vinit Shandilya
  • 1,643
  • 5
  • 24
  • 44

0 Answers0