1

하나의 listActivity가있는 간단한 데모 응용 프로그램이 있으며 actionBarSherlock을 사용하고 있습니다.ListView는 2.x에서 색상을 변경합니다.

내 styles.xml은 다음과 같습니다

<resources> 

    <style name="AppBaseTheme" parent="Theme.Sherlock"></style> 

    <style name="AppTheme" parent="AppBaseTheme"> 
     <item name="actionBarStyle">@style/Widget.MyTheme.ActionBar</item> 
     <item name="android:actionBarStyle">@style/Widget.MyTheme.ActionBar</item> 
     <item name="android:windowBackground">@android:color/white</item> 
    </style> 

    <style name="Widget.MyTheme.ActionBar" parent="Widget.Sherlock.ActionBar"> 
     <item name="android:background">#388E8E</item> 
     <item name="background">#388E8E</item> 
    </style> 

</resources> 

이 스타일이 나에게 작업 표시 줄에 흰색 텍스트 내 활동에 흰색 배경 2.x 및 3.x에서 파란색 액션 바 있습니다. Android 2.x 및 4.x에서 완벽하게 보입니다. 문제는 2.x에서 스크롤 할 때 검은 색 배경이 생기는 것입니다. 현재 SimpleAdapter를 사용 중입니다.

int[] ids = { android.R.id.text1, android.R.id.text2 }; 
SimpleAdapter adapter = new SimpleAdapter(this, aList, android.R.layout.simple_list_item_2, from, ids); 

어떻게 이런 일이 발생하지 않게 할 수 있습니까?

+0

예를 은 다음 링크를 참조. [1] : http://stackoverflow.com/questions/2792976/android-listview-produces-black-highlighting-over-text-when-scrolling-how-to-st [2] : HTTP : //stackoverflow.com/questions/14909686/fragment-inside-scrollview-gives-black-background-flickering – hharry

답변

2

안녕하세요 @EGHDK 귀하의 목록 페이지 문제입니다. listView 노드에 android : cacheColorHint = "# 00000000"을 추가하십시오. <ListView android:id="@+id/list" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_gravity="start" android:background="@color/somecolor" android:divider="@android:color/transparent" android:cacheColorHint="#00000000" />

관련 문제