Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to have a transparent ImageButton: Android

<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.

like image 846
Namratha Avatar asked Aug 04 '10 05:08

Namratha


People also ask

How to make ImageButton background transparent in android?

You can specify a transparent background for the image button. The result will be a clickable image that acts like a button but can look like whatever you want it to look like. Just set android:background="@null" for the image button.

How do I remove background from ImageButton?

You can use android:background="@null" for your ImageButton.


1 Answers

Try using null for the background ...

android:background="@null" 
like image 145
Quintin Robinson Avatar answered Sep 21 '22 04:09

Quintin Robinson