button_bg.xml
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<!-- pressed state / clicked state -->
<item
android:state_pressed="true"
android:state_enabled="true"
android:drawable="@color/bg_click_color"
/>
<!-- enabled state / default state-->
<item
android:state_enabled="true"
android:drawable="@android:color/transparent"
/>
</selector>
使用方法:
android:background="@drawable/button_bg"
沒有留言:
張貼留言