的ImageButton边境Transparancy - 如何消除周围圆形图像的方形边框? [英] ImageButton Border Transparancy - How do I remove the square border around round image?

查看:298
本文介绍了的ImageButton边境Transparancy - 如何消除周围圆形图像的方形边框?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我觉得我的形象是透明的,但我看到一个灰色的背景出现在我的图像的边缘是圆的。而不是漂亮的透明圆形的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"
     />

这篇关于的ImageButton边境Transparancy - 如何消除周围圆形图像的方形边框?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆