Reputation: 15
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
Reputation: 61
Simply set background color to transparent. the button will not be visible but will work for sure.
Upvotes: 1
Reputation: 13
You can simply use it dynamically
button.setBackgroundColor(Color.TRANSPARENT);
It will work definitely
Upvotes: 1
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
Reputation: 11
Possibly leave it "visible", but color it the same as the background.
Upvotes: 1