平时效果:
![](https://i-blog.csdnimg.cn/blog_migrate/0035309ac5326b7be65c2a66a937fa23.png)
按下效果:
![](https://i-blog.csdnimg.cn/blog_migrate/1e6e73b1068a0a9d11a035e60b31da45.png)
selector代码:
<?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_pressed="true"><shape> <solid android:color="@color/color_E9E9E9"/> <!-- 描边 --> <stroke android:width="1dp" android:color="@color/color_DDDDDD" /> <!-- 圆角 --> <corners android:radius="0dp" /> </shape></item> <item android:state_focused="true"><shape> <stroke android:width="1dp" android:color="@color/color_DDDDDD" /> <corners android:radius="0dp" /> </shape></item> <item><shape> <solid android:color="@color/color_F7F7F7"/> <stroke android:width="1dp" android:color="@color/color_DDDDDD" /> <corners android:radius="0dp" /> </shape></item> </selector>