Thursday, January 3, 2013

Android-Button onclick feel highlighting

Create a new xml file in drawable folder and have a selector in xml file


<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true" android:state_enabled="true" android:drawable="@drawable/login_selected"/>
    <item android:state_pressed="false" android:state_enabled="true" android:drawable="@drawable/login"/>
</selector>

In Button properties set background of button to this xml file.

No comments:

Post a Comment