0

is thr any way to change textview text shadow color

simillar to changing text color

<selector xmlns:android="http://schemas.android.com/apk/res/android">

<item android:color="@color/white" android:state_focused="true"/> <!-- focused -->
<item android:color="@color/white" android:state_focused="true" android:state_pressed="true"/> <!-- focused and pressed -->
<item android:color="@color/white" android:state_pressed="true" /> <!-- pressed -->
<item android:color="@color/black"/> <!-- default -->

Mr.G
  • 1,275
  • 1
  • 18
  • 48

2 Answers2

1

Create a style in styles.xml

<style name="myshadowstyle">   
    <item name="android:shadowColor">#ff8800</item>
    <item name="android:shadowRadius">2</item>
</style>

Now in your selector xml

<selector xmlns:android="http://schemas.android.com/apk/res/android">

<item style="@style/myshadowstyle" android:state_focused="true"/> <!-- focused -->
<item style="@style/myshadowstyle" android:state_focused="true" android:state_pressed="true"/> <!-- focused and pressed -->
<item style="@style/myshadowstyle" android:state_pressed="true" /> <!-- pressed -->
<item android:color="@color/black"/>
</selector>
Prateek
  • 3,923
  • 6
  • 41
  • 79
0
textView.setShadowLayer(2.0f, 0.0f, 0.0f, Color.GRAY);
Leebeedev
  • 2,126
  • 22
  • 31