ListView 항목에 문제가 있습니다. 나는 그것을 위해 listSelector를 사용하고있다. 누를 때 항목 변경 배경이 필요합니다. 그러나 그것을 누를 때 모든 항목이 배경을 바꿉니다. Android 2.3.6에서 발생합니다. 4.0.3 이상에서는 잘 작동합니다.ListView 항목 배경 문제
ListSelector
<selector xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/defaultSelector">
<item android:drawable="@color/defaultDashboardItemBackground" android:state_enabled="false" android:state_focused="true" android:state_pressed="false"/>
<item android:drawable="@color/defaultDashboardItemHover" android:state_pressed="true"/>
<item android:drawable="@color/defaultDashboardItemBackground" android:state_focused="true" android:state_pressed="false"/>
이 그것을 수정하는 데 도움을 줄 수 있습니다 귀하의 목록보기 android:cacheColorHint="@null"
이 속성을 설정하는 코드
ListView list = (ListView) act.findViewById(R.id.menu_listview);
list.setBackgroundColor(act.getResources().getColor(getThemeBackground(theme)));
list.setSelector(act.getResources().getDrawable(getThemeSelector(theme)));
list.addHeaderView(createHeader("HEADER"));
list.setAdapter(adap);
고마워요,하지만 작동하지 않습니다 : ( – asmproger