The text appears, and the @color/blue
is fine elsewhere in the code, what else is preventing the shadow from appearing? I have tried values of 1, 10, and 100 for the shadowDx
& shadowDy
as well as shadowRadius
. The shadow does not appear either in the editor (which apparently is expected TextView shadow not showing up in preview - although working on real device) or on my phone, which is my testing device.
<TextView
android:id="@+id/shadow_text"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="i should be shadowed ..."
android:textColor="@android:color/white"
android:shadowColor="@color/blue"
android:shadowRadius="2"
android:shadowDx="1"
android:shadowDy="1"
android:textSize="@dimen/text" />
It only works for me if I use float values. Try this:
<TextView
android:id="@+id/shadow_text"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="i should be shadowed ..."
android:textColor="@android:color/white"
android:shadowColor="@color/blue"
android:shadowRadius="2.0"
android:shadowDx="1.0"
android:shadowDy="1.0"
android:textSize="@dimen/text" />
And yes, the editor doesn't show the shadow, but it should also show a note that it isn't supported.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With