Search code examples
androidtextviewshadow

Android How does TextView Shadow work


I have textview with shadow to show,I put parameters of Shadow ShadowX and ShadowY and ShadowRadius like in following XML code

 <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" />

but I don't know that how Shadow X ,Shadow Y and Shadow Radius work in background and how android evaluate these parameters values conceptually?

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.

how does android logically use these above attribute values without specifying values in any format like ,please send me any tutorial URL about these attributes

dp pixel

if you have any tutorial and reference about shadow parameter then please help and send me the Blogs URL tutorial about these properties of Shadow


Solution

  • Please Refer the following link:

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

    You have to take the 3-4 textview's in yout xml file, then change the shadowDx, shadowDy and color of the shadow for each textview, then you will observe the difference.