1.通过shape进行转换
效果图 平时: 单击时
2.设置一个button
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/button_selectors"/>
3.在drawable下新建shape_normal.xml和shape_pressed.xml两个文件
4.分别打开两个xml文件编写代码
5.在button_selector.xml中指定资源文件,运行即可!