Search code examples
androideclipseimagebuttonscale

Android - Another button question


Its a dumb question. Prepare yourself.

My main.xml is this:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
 android:layout_width="fill_parent" 
 android:layout_height="fill_parent"
 android:background="@android:color/white">
 <ImageButton
 android:src="@drawable/button"
 android:scaleType="fitStart"
android:layout_height="fill_parent"
android:layout_width="wrap_content"
 /> 
</RelativeLayout>

It works. However, I actually SEE an android button with my image inside it. When you click it, the outside turns orange and everything. How do I get it so that the outside button DOESN'T appear?

Help please?


Solution

  • There are two possible ways to handle this:

    1. Set the a transparent background to the button.
    2. Use ImageView instead of the Button (you may want to set android:focusable="true" to make it focusable)