Reputation: 71
I have a custom button and its background is blue. I have used it in many activities but just in 1 place I want to make my button transparent without effecting other.
So how can I make transparent just one instance of custom button in my project?
Upvotes: 1
Views: 38
Reputation: 66
You can declare variable in custom component. Initialize the variable only in the class you want to make the component as transparent. Override on draw method apply transparent bg to canvas.
Upvotes: 2
Reputation: 867
You can add this in your XML: android:background="?android:attr/selectableItemBackground"
or this in your code: buttonVariable.setBackgroundColor(Color.TRANSPARENT);
Upvotes: 0