S
S
Sasha Brahms2016-07-30 17:02:54
Android
Sasha Brahms, 2016-07-30 17:02:54

How to implement text shadow/stroke?

Hello everyone, I ran into a problem to create a text stroke (I know that you can use a shadow, but I can’t create a shadow)
Please tell me how to create a shadow in:
1. TextView
2. Button (both the shadow of the button itself and the shadow of the text in the button)
I will very grateful, can't find an answer...
Tried like this:

android:shadowColor="#000"// так же пробовал @color/...
    android:shadowDx="-2"
    android:shadowDy="2"
    android:shadowRadius="0.01"

I played with all the parameters, no shadow is created :c
Please give me a seat

Answer the question

In order to leave comments, you need to log in

2 answer(s)
J
jestev, 2016-07-30
@jestev

Specifically textView:

<resources>
    <color name="light_font">#FBFBFB</color>
    <color name="grey_font">#ff9e9e9e</color>
    <color name="text_shadow">#7F000000</color>
    <color name="text_shadow_white">#FFFFFF</color>
</resources>

<TextView android:id="@+id/txt_example1"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:textSize="14sp"
                  android:textStyle="bold"
                  android:textColor="@color/light_font"
                  android:shadowColor="@color/text_shadow"
                  android:shadowDx="1"
                  android:shadowDy="1"
                  android:shadowRadius="2" />

You can experiment with the shadow
As for the button, I advise you to look here , a great example

F
Freddy Hardest, 2016-07-31
@zx80

In Layout in TextView add these lines:
android:shadowColor="#00ff00" //green
android:shadowRadius="3"

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question