Possible Duplicate:
how to set image button backgroundimage for different state?
I have the following declaring how a button should be drawn (uabutton.xml):
<?xml version="1.0" encoding="UTF-8"?>
<selector
xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true" >
<shape>
<corners
android:radius="3dp" />
<gradient
android:startColor="#000000"
android:endColor="#e9e8e9"
android:angle="270" />
</shape>
</item>
<item android:state_focused="true" >
<shape>
<corners
android:radius="3dp" />
<gradient
android:endColor="#ffffff"
android:startColor="#b9b9b9"
android:angle="270" />
</shape>
</item>
<item android:state_enabled="false">
<shape>
<corners
android:radius="3dp" />
<gradient
android:startColor="#f0aa9f"
android:endColor="#e21f00"
android:angle="270" />
</shape>
</item>
<item>
<shape>
<corners
android:radius="3dp" />
<gradient
android:startColor="#ff8a0e"
android:endColor="#e9e8e9"
android:angle="270" />
</shape>
</item>
</selector>
My question is, I would like to add an image to the background of each button. Where, if anywhere, in the above would I add the image.
The button is added a to a RelativeLayout
:
<Button
android:id="@+id/aboutualocationbtn"
android:text="Menu"
android:layout_width="60dp"
android:layout_height="60dp"
android:background="@drawable/uabutton"/>