是更改textview文本阴影颜色的任何方式,类似于更改文本颜色
<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 -->
答案 0 :(得分:1)
在styles.xml
<style name="myshadowstyle">
<item name="android:shadowColor">#ff8800</item>
<item name="android:shadowRadius">2</item>
</style>
现在在选择器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>
答案 1 :(得分:0)
textView.setShadowLayer(2.0f, 0.0f, 0.0f, Color.GRAY);