3

I'm developing and Android app. I have a main menu with lots of imagebuttons, each of which takes the user to a new view on click.

The problem I'm having is that surrounding each icon is a tinted rectangle that changes to a light blue colour when tapped. How do I remove this transparent square in the .xml layout file?

Many thanks in advance,

Eamorr
  • 9,872
  • 34
  • 125
  • 209
  • Is it perhaps a standard function of Android (depending upon version)? If so then you may need to subclass Imagebutton? – D-Dᴙum Jan 31 '13 at 12:37
  • 1
    maybe this link will be helpful http://stackoverflow.com/questions/9167900/how-to-create-borderless-buttons-in-android – Georgy Gobozov Jan 31 '13 at 12:41

3 Answers3

5

they probably have the default background from the android system. to remove that, 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

Cristian Holdunu
  • 1,880
  • 1
  • 18
  • 43
1

You could always use the framework's

android:background="@android:color/transparent"

But for what you are trying to archive this is the better solution:

android:background="@null"

Joaquim Ley
  • 4,038
  • 2
  • 24
  • 42
0

I know theres now rectangle or colour, when you use your own buttons.. create, implement and use them, then you wont have the rectangle

Eveli
  • 498
  • 1
  • 6
  • 27