Answer the question
In order to leave comments, you need to log in
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"
Answer the question
In order to leave comments, you need to log in
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" />
In Layout in TextView add these lines:
android:shadowColor="#00ff00" //green
android:shadowRadius="3"
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question