How to Use colorDx in a Text Shadow in a TextView/EditText
added in API Level 1Horizontal offset of the shadow. Must be a floating point value. (1, 1.2, etc.)
1. Create an Android project, if you don't already have one.
3. In the main.xml file, add the code below. (This makes a teal shadow color.)
shadowDx without shadowColor and shadowRadius will do nothing.
A positive shadowDx will have the shadow on the right side of the text. (shadowDx = "5")
A negative shadowDx will have the shadow on the left side of the text. (shadowDx = "-5")
<TextViewA positive shadowDx will have the shadow on the right side of the text. (shadowDx = "5")
A negative shadowDx will have the shadow on the left side of the text. (shadowDx = "-5")
...
android:shadowDx = "5"
android:shadowColor = ""#008080""
android:shadowRadius="1"
/>
4. Compile and run!
Related Articles:
- Add Shadow Color Behind Text in TextView/EditText
- Use colorDy in a Text Shadow in a TextView/EditText
- Use colorRadius in a Text Shadow in a TextView/EditText
- Set the Background Color for a TextView, using Background
- Change the Background Color of an EditText
- How to Set the Background Color in a TextView, using drawableBottom
Resources:
http://developer.android.com/reference/android/R.attr.html#shadowColor
http://developer.android.com/reference/android/widget/TextView.html#attr_android:shadowDx
http://developer.android.com/reference/android/R.attr.html#shadowDx