Cole Cole - 1 year ago 118
Android Question

Any way to remove the grey background from ImageButtons?

I have an ImageButton and I'd like to remove the ugly (IMHO) background that surrounds the Image. I could just add an ImageView, but they're very hard to get set perfectly in a Layout like the grey one pictured. [gravity "Center" doesn't make it go to the middle, just centers it Vertically.)

So any way to remove that?

enter image description here

Answer Source

Just use android:background="#0000" (#0000 same with #00000000) or

ImageButton imageButton = new ImageButton(this);
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download