I created an image button in my xml
<Button android:layout_height="wrap_content" android:id="@+id/send" android:layout_width="50dip" android:background="@drawable/button_back"> </Button>
and its background, like this "button_back.xml"
<?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_pressed="true" android:drawable="@drawable/back_pressed" /> <item android:state_focused="true" android:drawable="@drawable/back_focused" /> <item android:drawable="@drawable/back_normal" /> </selector>
works fine, but my problem is that the width of my button is 50 and the width of the image is 70. how can I fit this png to automatically resize my button. Right now, no matter what width I attach to my button, its width reaches the size of the width of a png image.
can someone help me how to do this.
thanks
source share