所以在一个ListView我有任务,例如“周日下午3点洗车”,我洗车后想点击任务(项目) ListView和更改颜色,以便我知道我已完成该任务。
<ListView
android:id="@android:id/list"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/nTask"
android:background="#FFFFFF" >
</ListView>
Color1.xml
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true" android:drawable="@drawable/selector_state_blue"/>
selector_state_blue.xml
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >
<gradient
android:angle="270"
android:endColor="#FF91B2FF"
android:startColor="#4491B2FF" />
<corners android:radius="10px" />
</shape>