Monday, 23 September 2013

Setting background as color in selector

Here is an example of xml file with selector for showing custom color background for specific element

<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">

    <item android:drawable="@color/white" android:state_pressed="true"/>

</selector>