ImageButton Border Transparency - How do I remove the square border around round image?

Set this attribute in your ImageButton XML android:background="@null"

<ImageButton android:src="@drawable/yourimagename"
     android:id="@+id/thebuttonid"
     android:layout_width = "wrap_content"
     android:layout_height = "wrap_content"
     android:background="@null"
     />

Or just set the background to Android's transparent color

<ImageButton android:src="@drawable/yourimagename"
     android:id="@+id/thebuttonid"
     android:layout_width = "wrap_content"
     android:layout_height = "wrap_content"
     android:background="@android:color/transparent"
     />

You could use ImageButton.setBackgroundResource(int) (android:background attribute) which will get rid of that border.

Costi

Tags:

Image

Android