Tuesday, February 21, 2012

How to Set TextView Shadow in Android?


Text Shadow

You can use three different attributes to customize the appearance of your text shadow:
  • android:shadowColor Shadow color in the same format as textColor.
  • android:shadowRadius Radius of the shadow specified as a floating point number.
  • android:shadowDx The shadow’s horizontal offset specified as a floating point number.
  • android:shadowDy The shadow’s vertical offset specified as a floating point number.
The floating point numbers don’t have a specific unit – they are merely arbitrary factors.
<TextView
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:text="A light blue shadow."
            android:shadowColor="#00ccff"
            android:shadowRadius="1.5"
            android:shadowDx="1"
            android:shadowDy="1"
            />


No comments:

Post a Comment