Android TextView 阴影是如何工作的

Android How does TextView Shadow work

我有带阴影的文本视图要显示,我把 Shadow ShadowX 和 ShadowY 以及 ShadowRadius 的参数放在下面的 XML 代码中

 <TextView
            android:id="@+id/Title"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:shadowDx="1"
            android:shadowDy="1"
            android:shadowColor="#e41919"
            android:shadowRadius="0.6"
            android:text="@string/nader"
            android:textColor="#e1e1e1"
            android:textStyle="bold" />

但我不知道 Shadow X、Shadow Y 和 Shadow Radius 在后台如何工作 以及如何 android 从概念上评估这些参数值?

android:shadowDx – specifies the X-axis offset of shadow. You can give -/+ values, where -Dx draws a shadow on the left of text and +Dx on the right

android:shadowDy – it specifies the Y-axis offset of shadow. -Dy specifies a shadow above the text and +Dy specifies below the text.

android:shadowRadius – specifies how much the shadow should be blurred at the edges. Provide a small value if shadow needs to be prominent.

android 如何在不指定任何格式的值的情况下逻辑地使用上述属性值,请将有关这些属性的任何教程 URL 发送给我

dp pixel

如果您有任何关于影子参数的教程和参考,请帮助并向我发送有关影子这些属性的博客URL教程

请参考以下link:

http://android--code.blogspot.in/2015/05/android-textview-text-shadow.html

你必须在你的 xml 文件中取出 3-4 个 textview,然后为每个 textview 更改阴影的 shadowDx、shadowDy 和颜色,然后你会观察到差异。

在TextView中添加属性XML:

android:shadowColor="#ff6ccDze0"
android:shadowRadius="5"
android:shadowDy="6"
android:shadowDx="7"