I have an application in Android 2.3.3. There are few buttons in it. I want a functionality (for the buttons) similar to that of qwerty keyboard, where in when we press a key or a letter, that character will be shown for a fraction of a second, just above the place where that character is present in the keyboard.
Do we have any such kind of properties built in?
If there is no such thing, i am using a background color to my buttons and it's hard to get a note of whether the button is clicked or not. Can we somehow make it visible that the button is clicked.
Your looking for a selector somehting like this inside your drawable folder. To reference it just call it like a drawable.
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true" android:drawable="@drawable/buttonpressed" />
<item android:drawable="@drawable/buttonnotpressed" /> <!-- default -->
</selector>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With