给TextView的文字加阴影

在styles.xml文件中加入下面两个样式,然后在需要的地方设置TextView的style
  1.         <!-- 文字白色阴影style-->
  2.         <style name="text_white_shadow">
  3.                 <item name="android:shadowColor">@color/white</item>
  4.                 <item name="android:shadowDy">-2</item>
  5.                 <item name="android:shadowRadius">1</item>
  6.         </style>
  7.         <!-- 文字黑色阴影style-->
  8.         <style name="text_black_shadow">
  9.                 <item name="android:shadowColor">@color/black</item>
  10.                 <item name="android:shadowDy">-2</item>
  11.                 <item name="android:shadowRadius">1</item>
  12.         </style>
复制代码
路漫漫其修远兮 吾将上下而求索
原文地址:https://www.cnblogs.com/hudabing/p/3432515.html