ImageButton边框透明度 - 如何删除圆形图像周围的方形边框? [英] ImageButton Border Transparency - How do I remove the square border around round image?
本文介绍了ImageButton边框透明度 - 如何删除圆形图像周围的方形边框?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我认为我的图像是透明的,但我看到我的图像边缘出现了一个圆形的灰色背景。因此,我没有看到漂亮的透明圆形ImageButton。我需要提供高度或它抱怨,但现在我有圆形图像的灰色/银色方形的概述。
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:background =@ null
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边框透明度 - 如何删除圆形图像周围的方形边框?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文