How can we change the background colour of a Border less button when the button is pressed.
I used this:
android:background="?android:attr/selectableItemBackground"
android:text="@string/btn_skip"
Where my button Displays a label “SKIP” as defined in my “strings.xml”.
Now When I test this it is Good Except It shows default “Blue” Colour when in Pressed State.
I want it to match it with other elements of my My UI theme that are “Orange” “#FF8800”
Any Ideas?
Thankx in advance…!
Thanks @Nimish-Choudhary …! I followed your advice. and I have explained it further for clarity to all having same question as me as a beginner.
Create an xml with name say "btntransparent.xml"
Next add the colors "pressed" and "defaultColor" to another xml say "colors.xml"
Here "#CCFF8800" is my pressed state Translucent Orange and "#00000000" is the 100% Transparent Black (;-) thats invisible). You can find more about color codes at Color| Android Developers
Now put the "colors.xml" in values Folder and "btntransparent.xml" in drawable Folder.
Now the last step is to voila use it in the button as
And thats should do the job…!
Take care.
regards,
raisedadead