4

I want to know how to make my text glow in android, I know how to do via xml with some attributes, like this:

android:shadowColor="#6A8B00"
android:shadowDx="3"
android:shadowDy="3"
android:shadowRadius="10"
android:text="@string/glowText"
android:textColor="#E15529"
android:textSize="30sp"

but I want to do via code, then I can control better and make glow more or less in different situations. Maybe has something like view.setGlow?

Ricardo A.
  • 685
  • 2
  • 8
  • 35

1 Answers1

8

You can use setShadowLayer (float radius, float dx, float dy, int color) on your textview. For example:

textView.setShadowLayer(30, 0, 0, Color.RED);

Found in the TextView documentation

chris-pollux
  • 309
  • 2
  • 7