的ImageButton边境Transparancy - 如何消除周围圆形图像的方形边框?边框、方形、边境、圆形

2023-09-05 06:42:09 作者:站住,给你糖i

我觉得我的形象是透明的,但我看到一个灰色的背景出现在我的图像的边缘是圆的。而不是漂亮的透明圆形的ImageButton所以,我看到了广场边缘。我需要提供身高,或者抱怨,但现在我有刚轮图像的灰度/银广场instread轮廓。

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.

推荐答案

设置这个属性在你的ImageButton XML的android:背景=@空

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"
     />