Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove ImageButton's standard background image?

In ImageButton I want to remove the standard button background image. In http://developer.android.com it is said, that one must define his\her own background image or set the background color to be transparent. I tried to set a black background, but it didn't make any effect...

like image 966
lomza Avatar asked Mar 28 '11 09:03

lomza


2 Answers

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

See also:
    Android Developers official guide on Buttons

like image 186
Mudassir Avatar answered Oct 02 '22 09:10

Mudassir


The best choice is not set a transparent background to your ImageButton.

Give to your user a feedback when the button is tapped.

android:background="?attr/selectableItemBackgroundBorderless" 
like image 23
Filipe Brito Avatar answered Oct 02 '22 07:10

Filipe Brito