리스트뷰를 스크롤할때 배경이 검정색이되요

조회수 2634회

제가 스크롤이 가능한 리스트뷰를 만들었어요. 각 리스트에는 왼쪽에 이미지랑 오른쪽에 텍스트가있구요

root 레이아웃은

<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent" 
android:layout_height="fill_parent"
android:background="#C8C8C8"
>
<TextView
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"/>
<ListView
    android:id="@android:id/list"
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent"
    android:drawSelectorOnTop="false"
    android:divider="#C8C8C8"
    android:background="#C8C8C8"/>

이러고 리스트의 원소는

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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/bg_row"
>
    <ImageView
        android:layout_width="wrap_content"
        android:paddingLeft="10px"
        android:paddingRight="15px"
        android:paddingTop="5px"
        android:paddingBottom="5px"
        android:layout_height="wrap_content"
        android:src="@drawable/bg_image"
    />
    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:paddingTop="5px"
        android:paddingBottom="5px"
        android:textSize="16sp"
        android:textColor="#000000"
        android:layout_gravity="center"
        android:maxHeight="50px"/>
</LinearLayout>

처음 화면은 제가 원하는것처럼 잘나오구요. 가만히 냅두면 괜찮은데 제가 스크롤을 하기시작하면 행의 항목은 잘 출력되는데 root레이아웃이 완전 까맣게 돼요. 그러다 스크롤하는걸 멈추면 좀 시간 지나고 다시 root레이아웃이 원래 색으로 돌아와요... 제가 실험하려고 root레이아웃에 똑같은 배경색을 가지는 텍스트뷰를 추가했는데 이건 또 스크롤할때 괜찮아요... 대체 뭐가 문제인걸까요... 어떻게 해결하죠...??

1 답변

답변을 하려면 로그인이 필요합니다.

프로그래머스 커뮤니티는 개발자들을 위한 Q&A 서비스입니다. 로그인해야 답변을 작성하실 수 있습니다.

(ಠ_ಠ)
(ಠ‿ಠ)