How To Alter Android Push On Click/Press Color

Posted on 39 views

In this unproblematic tip, I’m going to demo how to modify android push clit on click or press color. If y’all desire to modify the click or press color of TextView or whatsoever android Layout y’all tin exercise same way. Android Button onClick Event teaches y’all to grip push clit click as well as y’all tin detect dissimilar android push clit agency at Android Button Examples.

Android Elevation Example
Relative Layout – Views Position inwards Android
Android Elevation Example

Define Color Value

To define color value, y’all convey to exercise colors.xml file inwards your projection values directory as well as add together following.

Create a XML File inwards Drawable Directory

Create a button_background.xml file inwards your drawable folder as well as add together push clit pressed/clicked, focused as well as default color. Final code of button_background.xml file looks similar this.

Adding Buttons


Now, run your application as well as click whatsoever of 2 buttons. You volition encounter dissimilar color at the fourth dimension of click. In next screenshot, start push clit is at the fourth dimension of push clit click/press as well as merely about other is default.

m going to demo how to modify android push clit on click or press color How to Change Android Button on Click/Press Color

READ  Google's new avatar Nexus 7 गूगल का नया अवतार नेक्सस 7