android - XML drop shadow and different states -


i'm trying define background listview has drop shadow , different colours pressed state. here's have.

<?xml version="1.0" encoding="utf-8"?> 

<!-- drop shadow stack --> <item>     <shape>         <padding android:bottom="1dp"/>         <solid android:color="#00cccccc" />     </shape> </item> <item>     <shape>         <padding  android:bottom="1dp"  />         <solid android:color="#10cccccc" />     </shape> </item> <item>     <shape>         <padding android:bottom="1dp"  />         <solid android:color="#20cccccc" />     </shape> </item> <item>     <shape>         <padding android:bottom="1dp" />         <solid android:color="#30cccccc" />     </shape> </item> <item>     <shape>         <padding android:bottom="1dp" />         <solid android:color="#50cccccc" />     </shape> </item>  <!-- background --> <item android:state_pressed="true">     <shape>         <solid android:color="@color/fublue" />     </shape> </item> <item android:state_activated="true">     <shape>         <solid android:color="@color/fublue" />     </shape> </item> <item>     <shape>         <solid android:color="@color/white" />     </shape> </item> 

however, doesn't work. need change working?

i'm not entirely sure you're doing drop-shadow, press states, must make list view item layouts clickable. , create background selector drawable push states.

standard style file

yourcolorstates.xml

<?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"     xmlns:platformrq="http://schemas.android.com/apk/res-auto" >     <item         android:background="#yourneutralcolor"         android:state_pressed="false" />     <item         android:background="#yourpressedcolor"         android:state_pressed="true" /> </selector> 

Comments

Popular posts from this blog

c# - How Configure Devart dotConnect for SQLite Code First? -

c++ - Clear the memory after returning a vector in a function -

erlang - Saving a digraph to mnesia is hindered because of its side-effects -