在res文件夹下新建一个文件夹drawable,这是无关分辨率的:
在下面建立一个xml文件:shape.xml
<!--按钮点击state_pressed之后颜色-->
<item android:state_pressed="true">
<shape>
<solid android:color="@color/colorBule" />
<corners android:radius="5dp" />
</shape>
</item>
<!--android:state_enabled 能够接受触摸或者点击事件-->
<item
android:state_enabled="false">
<shape>
<solid android:color="@color/colorH" />
<corners android:radius="5dp" />
</shape>
</item>
<!--按钮默认颜色-->
<item>
<shape>
<solid android:color="@color/colorDefaultBule" />
<corners android:radius="5dp" />
</shape>
</item></selector>