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.
You could use ImageButton. setBackgroundResource(int) (android:background attribute) which will get rid of that border.
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 .
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" />
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With