Any way to remove the grey background from ImageButtons?
Any way to remove the grey background from ImageButtons?
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.)
So any way to remove that?
Answer by ByteMe for Any way to remove the grey background from ImageButtons?
if you set the
android:background
instead of
android:src
it should overwrite the gray background
Answer by dong221 for Any way to remove the grey background from ImageButtons?
The default background is not transparent.
So, just add the transparent color "#00000000" as you background, then you could solve it.
p.s. #00000000 is the transparent color
Answer by Sadeshkumar Periyasamy for Any way to remove the grey background from ImageButtons?
Yeah. If you drag ImageButton that will usually ask for ImageSource. But the ImageSource(android:src) doesn't remove the gray background. It is an image that should be on top of background:
Instead of that try android:background in layout XML.
Answer by Nguyen Minh Binh for Any way to remove the grey background from ImageButtons?
Just use android:background="#0000"
(#0000 same with #00000000) or
ImageButton imageButton = new ImageButton(this); imageButton.setBackgroundDrawable(null);
Answer by user1161960 for Any way to remove the grey background from ImageButtons?
please use the Draw 9-patch format for the image b'use it is provided by SDK
1. From a terminal, launch the draw9patch application from your SDK /tools directory. 2. Drag your PNG image into the Draw 9-patch window (or File > Open 9-patch... to locate the file). Your workspace will now open.
The left pane is your drawing area, in which you can edit the lines for the stretchable patches and content area. The right pane is the preview area, where you can preview your graphic when stretched.
3. Click within the 1-pixel perimeter to draw the lines that define the stretchable patches and (optional) content area. Right-click (or hold Shift and click, on Mac) to erase previously drawn lines. 4. When done, select File > Save 9-patch...
Your image will be saved with the .9.png file name.
Answer by Jaspinder Kaur for Any way to remove the grey background from ImageButtons?
just useandroid:background="@null"
in your xml
Fatal error: Call to a member function getElementsByTagName() on a non-object in D:\XAMPP INSTALLASTION\xampp\htdocs\endunpratama9i\www-stackoverflow-info-proses.php on line 72
0 comments:
Post a Comment