您需要两个图像,一个用于正常状态,另一个用于按下状态。首先创建一个选择器
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/pressed_image" android:state_pressed="true"/>
<item android:drawable="@drawable/normal_image"/>
</selector>
在您的按钮中将此选择器添加为背景。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句