2011-08-06 3 views
0

흰색 바탕에있는 활동에 ListView를 만들었습니다. 그러나 항목을 스윕하면 배경이 검은 색이되고 텍스트가 나옵니다. 어떻게 비활성화 할 수 있습니까? listview는 ArrayAdapter를 사용하여 채 웁니다.목록보기에서 청소 항목 사용 안 함

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:layout_width="fill_parent" 
android:layout_height="wrap_content" 
android:orientation="vertical" 
android:background="#F2F2F2"> 
<LinearLayout android:id="@+id/newEntry" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:orientation="horizontal"> 
    <EditText android:id="@+id/txtNewItem" android:layout_width="wrap_content" android:layout_height="fill_parent" android:selectAllOnFocus="true" 
     android:layout_weight="1" android:maxLength="8" android:inputType="numberSigned|numberDecimal"/> 
    <Button android:id="@+id/btnNewItem" android:text="@string/add_item" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textSize="24sp" /> 
</LinearLayout> 
<LinearLayout android:id="@+id/controlPanel" 
    android:layout_alignParentBottom="true" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content"> 
    <Button android:id="@+id/btnClearList" android:layout_weight="1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/clear_list"/> 
    <Button android:id="@+id/btnConfirmList" android:layout_weight="1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/confirm_btn"/> 
</LinearLayout> 
<ListView android:id="@+id/android:list" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:layout_above="@id/controlPanel" 
    android:layout_below="@id/newEntry" /> 
<TextView android:id="@+id/android:empty" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:text="@string/no_items" 
    android:layout_below="@id/newEntry" 
    android:textColor="#000000" /> 
</RelativeLayout> 

답변

0

당신은을 사용하여 할 수 있습니다. 이 줄을 xml의 ListView에 추가하십시오.

android:scrollingCache="false" 
+0

감사합니다. – user881649

0

이 가능리스트 뷰 배경 그리기 문제 :

여기 내 목록보기 XML입니다. 토론 및 수정 사항은 this 문서를 확인하십시오.

활동에 대한 배경색과 기본 테마 (명암) 사이에 약간의 간섭이있을 수도 있습니다. 테마를 밝은 버전 (Theme.Light)으로 변경해보십시오.