2012-06-13 1 views
1

기본 레이아웃과 배경색이 다른 중첩 레이아웃이있는 레이아웃이있는 목록보기가 있습니다.목록보기 레이아웃 배경색 깜박임이 이미지로드에서 사라집니다?

이 중첩 된 레이아웃 내부에는 이미지 뷰가 있습니다. 이미지가 뷰에로드 될 때마다이 중첩 된 레이아웃의 배경색이 사라집니다. 목록보기가 스크롤 될 때까지 배경이 돌아 오지 않습니다.

또한 listview를 스크롤 할 때 이미지 뷰의 이미지가 다시 그려지며이 순서가 다시 발생하여 목록에 깜박 거리는 효과가 나타납니다.

주 레이아웃과 중첩 된 레이아웃 모두에서 cacheColorHint 속성을 설정해 보았지만 변경되지 않은 것 같습니다.

다음은 이미지를로드 할 때 발생하는 일례/스크롤링의 예입니다. 보시다시피 하단의 두 항목에 대한 배경색은 사라지고 나머지는 여전히 배경색을가집니다. 여기

enter image description here

중첩 레이아웃리스트 뷰 레이아웃의 일부이다.

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:id="@+id/race_entrant" 
android:layout_width="fill_parent" 
android:layout_height="wrap_content" 
android:minHeight="?android:attr/listPreferredItemHeight" 
android:paddingTop="2dip" 
android:paddingBottom="2dip" 
android:paddingRight="2dip" 
android:orientation="horizontal" 
android:descendantFocusability="blocksDescendants" 
android:cacheColorHint="#E0EAF1"> 
<LinearLayout 
    android:layout_height="fill_parent" 
    android:layout_width="50dip" 
    android:orientation="vertical" 
    android:id="@+id/linearLeft" 
    android:paddingLeft="2dip" 
    android:paddingRight="2dip" 
    android:paddingTop="2dip" 
    android:paddingBottom="2dip" 
    android:background="#E0EAF1" 
    android:cacheColorHint="#E0EAF1"> 
    <TextView 
     android:id="@+id/txtEntrantNo" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     style="@style/entrant_number" 
     android:layout_gravity="center_horizontal" 
     android:cacheColorHint="#E0EAF1" /> 
     <ImageView 
      android:id="@+id/imgJockey" 
      android:layout_width="fill_parent" 
      android:layout_height="fill_parent" 
      android:layout_gravity="center_horizontal" 
      android:layout_marginTop="1dip" 
      android:adjustViewBounds="true" 
      android:cacheColorHint="#E0EAF1" /> 
</LinearLayout> 

어떻게 같이 사라지고에서 중첩 된 레이아웃의 배경색을 중지 할 수 있습니다?

답변

0

이미지 뷰의 배경색을 설정하여이 기능을 사용할 수있었습니다.

이 작업을 수행하기 위해 XML

했다 : 이제 이미지가 변경되지 않습니다 배경색을로드 할 때

android:background="#E0EAF1" 

.

7

이 나를 위해 문제를 해결 :이 그냥 사람을 도움이 될 listView.setCacheColorHint(Color.TRANSPARENT);

.

관련 문제