Android: Image set as button background is not being shrunk?

Max7

New Member
I created a button with an image set as the background through a drawable. When I run the program the image is not being centered nor shrunk to fit the button. But when you click it, the pressed image is showing properly. This was working just the other day and I have no clue what happened to change it. main.xml\[code\]<Button android:id="@+id/rightarrow" android:layout_width="0dp" android:layout_height="fill_parent" android:layout_weight="1" android:background="@android:color/transparent" android:clickable="false" />\[/code\]Activity.java\[code\]rightarrow = (Button) findViewById(R.id.rightarrow);rightarrow.setBackgroundResource(R.drawable.rightarrow_drawable);\[/code\]rightarrow_drawable.xml\[code\]<?xml version="1.0" encoding="utf-8"?><selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:drawable="@drawable/rightarrow_pressed" android:state_pressed="true"/> <item android:drawable="@drawable/rightarrow" /></selector>\[/code\]
 
Back
Top