1

Possible Duplicate:
Android - shadow on text?

how to add shadow on text in android?

i am using this.

text-shadow: 5px 5px 5px black;

but this is not working in android devices...

Community
  • 1
  • 1
cgvector
  • 931
  • 1
  • 10
  • 13

3 Answers3

1

Android browser renders the style background-image very poorly. Here's the useful article on this topic.

Better to use the following: android:shadowDx, android:shadowDy, android:shadowRadius.

For instance:

<TextView android:id="@+id/txt_1"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:textSize="14dp"
              android:textStyle="bold"
              android:textColor="@color/light_font"
              android:shadowColor="@color/text_shadow"
              android:shadowDx="1"
              android:shadowDy="1"
              android:shadowRadius="2" />
kapandron
  • 3,546
  • 2
  • 25
  • 38
1

The code you have written is for background, If you want to add shadow in text it's done using this CSS,

text-shadow: 0 1px 0 #000;

or

text-shadow: 0 1px 1px #Ff0000;

Salil Momin
  • 361
  • 3
  • 11
  • 2
    Note that there's a nasty android bug where text-shadow is ignored if the blur radius is set to less than one pixel. This caught me out for ages.. Here's the bug report http://code.google.com/p/android/issues/detail?id=7531 – Ben Clayton May 03 '12 at 09:53
  • this text shadow problem in android – cgvector May 07 '12 at 09:27
0

Have you tested with the tag text-shadow?

text-shadow: 5px 5px 5px black;
Julien
  • 3,509
  • 20
  • 35