Wednesday, 1 July 2015

Styling EditText in Android .

edit_text.xml


<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item
        android:state_window_focused="false"
        android:state_enabled="true"
        android:drawable="@drawable/textfield_default" />
 
    <item
        android:state_window_focused="false"
        android:state_enabled="false"
        android:drawable="@drawable/textfield_disabled" />
 
    <item
        android:state_pressed="true"
        android:drawable="@drawable/textfield_pressed" />
 
    <item
        android:state_enabled="true"
        android:state_focused="true"
        android:drawable="@drawable/textfield_selected" />
 
    <item
        android:state_enabled="true"
        android:drawable="@drawable/textfield_default" />
 
    <item
        android:state_focused="true"
        android:drawable="@drawable/textfield_disabled_selected" />
 
    <item
        android:drawable="@drawable/textfield_disabled" />
 
</selector>

Hear , Instead of Attach Drawable , you can give Color (solid ) , Border etc..

No comments:

Post a Comment