Я создаю собственный ListView, как показано ниже
Основной макет
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center">
<ListView android:id="@+id/listview"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_margin="3dip"
android:fadingEdge="none"
android:soundEffectsEnabled="true"
android:clickable="true"
android:scrollbars="none"
android:divider="#ffcccccc"
android:dividerHeight="1dip"
android:layout_weight="1"/>
</LinearLayout>
Пользовательский ListView
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:background="@drawable/sellistitem">
<TextView
android:id="@+id/ListItem"
android:layout_width="wrap_content"
android:layout_height="30dip"
android:layout_margin="1dip"
android:textColor="@color/BLACK"
android:gravity="center_vertical"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:padding="5dip"/>
</RelativeLayout>
и селектор, как показано ниже
<selector
xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true" android:drawable="@drawable/BLUE" />
<item android:drawable="@drawable/WHITE" />
</selector>
Drawable
<resources>
<drawable name="WHITE">#ffffff</drawable>
<drawable name="BLUE">#ff0033cc</drawable>
</resources>
Сделав это, часть выбора работает нормально.Однако, когда я нажимаю на любой элемент, выбранный элемент мигает два раза, прежде чем фактически становится синим.Он не меняется на синий напрямую, как должно.Как убрать этот мигающий эффект?
С уважением,