2012년 8월 14일 화요일

ListView getView() 다중 호출

설계상의 문제인지는 모르겠는데 2번, 3번 중복해서 호출될 때가 있다.

그럴 때는 ListView의 Height을 wrap_content 가 아닌 fill_parent ( 또는 match_parent )로 바꿔주고

ListView를 감싸고 있는 Layout도 Height을 fill_parent ( 또는 match_parent ) 로 주면 해결된다.



<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="#FFFFFF"
    android:orientation="vertical" >
 
    <ListView
        android:id="@android:id/list"
        android:layout_width="fill_parent"
  android:layout_height="fill_parent"
  android:background="#ffffff"
  android:listSelector="#00000000"
  android:divider="#00000000"
  android:cacheColorHint="#00000000" />

</LinearLayout>

댓글 없음: