How to have a transparent ImageButton: Android

<ImageButton android:id="@+id/previous"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="https://stackoverflow.com/questions/3402787/@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.

22 s
22

Try using null for the background …

android:background="@null"

Leave a Comment