Android 在列表视图中,当单击列表项时,应在第二次(仅单击项)时闪烁不同颜色的背景,我如何才能做到这一点?
我的列表视图Android 在列表视图中,当单击列表项时,应在第二次(仅单击项)时闪烁不同颜色的背景,我如何才能做到这一点?,android,Android,我的列表视图 <ListView android:id="@+id/list" android:layout_marginLeft="10dip" android:layout_below="@+id/date" android:layout_width="fill_parent" android:layout_height="wrap_content" android:fadingEdge="none" android:focusable="true" andro
<ListView android:id="@+id/list" android:layout_marginLeft="10dip"
android:layout_below="@+id/date" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:fadingEdge="none"
android:focusable="true" android:background="@drawable/newshape_list"
android:cacheColorHint="#ffffffff" android:scrollbars="none"
android:layout_marginRight="10dip" android:dividerHeight="1dip"
android:footerDividersEnabled = "false" android:headerDividersEnabled = "false"
android:paddingLeft="1dip" android:paddingRight="1dip"
android:layout_marginTop="8dip" android:divider="#A9ABAD"
android:layout_marginBottom="60dip"/>
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:state_pressed="true"
android:state_selected="false"
android:drawable="@drawable/focused"/>
<item
android:state_pressed="true"
android:state_focused="false"
android:drawable="@drawable/selected" />
</selector>
<?xml version="1.0" encoding="utf-8"?>
<resources>
<drawable name="focused">#ff5500</drawable>
<drawable name="selected">#FF00FF</drawable>
</resources>
lv1 = (ListView) findViewById(R.id.list);
lv1.setSelector( R.drawable.list_selector);