Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

android

image

I think my image is transparent, but I am seeing a grey background appearing around the edges of my image which is round. So instead of nice transparent round ImageButton I am seeing square edges. I need to provide height or it complains but now I have outline of grey/silver square instread of just round image.

like image 801
Androider Avatar asked Mar 21 '11 05:03

Androider


People also ask

How to remove border from ImageButton android studio?

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

How do I remove background from ImageButton?

You can use android:background="@null" for your ImageButton. Save this answer. Show activity on this post. The best choice is not set a transparent background to your ImageButton .


1 Answers

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"      /> 
like image 94
Ryan Reeves Avatar answered Oct 13 '22 22:10

Ryan Reeves