由网友(菊部地區有陣血)分享简介:我有一个ImageButton的,我想删除环绕影像丑陋(恕我直言)的背景。我可以只添加一个ImageView的,但他们很难得到像灰色的图片中显示的布局完全设置。 [万有引力中心,不让它去到中路,中心只是将其垂直)。I have an ImageButton and I'd like to remove the ugl...
我有一个ImageButton的,我想删除环绕影像丑陋(恕我直言)的背景。我可以只添加一个ImageView的,但他们很难得到像灰色的图片中显示的布局完全设置。 [万有引力中心,不让它去到中路,中心只是将其垂直)。
I have an ImageButton and I'd like to remove the ugly (IMHO) background that surrounds the Image. I could just add an ImageView, but they're very hard to get set perfectly in a Layout like the grey one pictured. [gravity "Center" doesn't make it go to the middle, just centers it Vertically.)
所以没有办法删除?
推荐答案
只需使用的android:背景=#0000
(#0000同样以#00000000)或
Just use android:background="#0000"
(#0000 same with #00000000)
or
ImageButton imageButton = new ImageButton(this);
imageButton.setBackgroundDrawable(null);
相关推荐
最新文章