The Dude
The Dude

Reputation: 15

How do you make an invisible button that works

So I want to create an invisible button, but when I try to do that button becomes invisible but it doesn't works at all. How can I make it so that it's invisible but still working?

Upvotes: 0

Views: 68

Answers (4)

prabhaat
prabhaat

Reputation: 61

Simply set background color to transparent. the button will not be visible but will work for sure.

Upvotes: 1

You can simply use it dynamically

button.setBackgroundColor(Color.TRANSPARENT);

It will work definitely

Upvotes: 1

narcis dpr
narcis dpr

Reputation: 1133

you show use transparent color for the background and remove the text, here is the XML:

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

and java code if you want to do it dynamically:

buttonVariable.setBackgroundColor(Color.TRANSPARENT);

Upvotes: 1

Bob Sander-Cederlof
Bob Sander-Cederlof

Reputation: 11

Possibly leave it "visible", but color it the same as the background.

Upvotes: 1

Related Questions