Android imagebutton: how to remove a rendered rectangle around an image?
I am developing an android application. I have a main menu with a lot of image buttons, each of which takes the user to a new view when clicked.
The problem I ran into is that the surrounding each icon is a shaded rectangle that changes to blue when clicked. How can I remove this transparent square in the .xml layout file?
Thank you very much in advance,
+3
source to share
3 answers
they probably have a default background from the android system. to remove this define a transparent color
<color name="transparent">#00000000</color>
and then use it as background in your buttons
<ImageButton android:src="@drawable/button"
android:background="@color/transparent"/>
I think it will work the way you want
+5
source to share