设置文字内容阴影效果

创建一个style文件在values文件夹下

<?xml version="1.0" encoding="utf-8"?>
<resources>

    <style name="styleTest">
        <item name="android:textColor">#FFFFFF</item>
        <item name="android:shadowColor">#ffffff00</item>
        <item name="android:shadowDx">10</item>
        <item name="android:shadowDy">0</item>
        <item name="android:shadowRadius">20</item>
     </style>
</resources>

这里

android:shadowColor 阴影颜色
android:shadowDx 阴影的水平偏移量
android:shadowDy 阴影的垂直偏移量
android:shadowRadius 阴影的范围
然后在控件中引用style

<TextView
      android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        style="@style/styleTest"
        android:id="@+id/tv1"
        android:text="凤姐驾到" />
 

原文地址:https://www.cnblogs.com/xilinch/p/2651198.html