How to have a transparent ImageButton: Android

Namratha picture Namratha · Aug 4, 2010 · Viewed 297.9k times · Source
<ImageButton android:id="@+id/previous"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/media_skip_backward"
android:background="@drawable/transparent"></ImageButton>

This is what I tried to get a transparent ImageButton so as to place those buttons on a SurfaceView. But Eclipse, gives me an error in the project as soon as I include the transparent line in xml.

Please help.

Answer

Quintin Robinson picture Quintin Robinson · Aug 4, 2010

Try using null for the background ...

android:background="@null"