this is my coding part:
listview.xml:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
<ListView
android:id="@+id/list"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:divider="#FFFFFF"
android:dividerHeight="7dp"
android:layout_weight="1"
android:listSelector="@drawable/list_selector" />
</LinearLayout>
list_selector.xml file:
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:state_selected="false"
android:state_pressed="false"
android:drawable="@drawable/gradient_bg" />
<item android:state_pressed="true"
android:drawable="@drawable/gradient_bg_hover" />
<item android:state_selected="true"
android:state_pressed="false"
android:drawable="@drawable/gradient_bg_hover" />
</selector>
gradient_bg.xml:
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<gradient
android:startColor="#e8eef4"
android:centerColor="#fdfdfd"
android:endColor="#d3dfe8"
android:angle="270" />
<stroke android:width="1dp" android:color="#b7ccdd" />
<padding android:left="6dp" android:top="6dp" android:right="6dp"
android:bottom="6dp" />
<margin android:left="15dp" android:top="15dp" android:right="15dp"
android:bottom="15dp" />
<corners android:radius="4dp" />
</shape>
gradient_bg_hover.xml:
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<gradient
android:startColor="#ffe181"
android:centerColor="#f5cd4a"
android:endColor="#e8c34e"
android:angle="270" />
<stroke android:width="1dp" android:color="#e3b52c" />
<padding android:left="6dp" android:top="6dp" android:right="6dp"
android:bottom="6dp" />
<margin android:left="15dp" android:top="15dp" android:right="15dp"
android:bottom="15dp" />
<corners android:radius="4dp" />
</shape>
Here i got the o/p :
But i wish to need the o/p like:
please compare the hover state on both images and give me solution for this..
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…