Button States in android like paused,selected and pressed

Leave a Comment
Here I am going to demonstrate the How to handle button state using xml in android.
Basically button has three states:
       1.       Selected

       2.       Pressed

       3.       Focused

You can handle this state using xml file as well as by java coding.

For Selected State I am using android attribute android:state_selected value to this attribute is true when button is selected.

For Pressed State I am using android attribute android:state_pressed value to this attribute is true when button is selected.

For Focused State I am using android attribute android:state_focused value to this attribute is true when button is selected.



Download


0 comments:

Post a Comment