2012-08-05 2 views
1

스크린 샷하십시오있는 ScrollView를 사용하는 경우 어떤 이유로 내 목록보기에 아무것도 이상한 흰색 영역을 얻을 위에 ListView가 ScrollView로 인해 이상하게 작동합니까?

http://i46.tinypic.com/2r44hg3.jpg

으로이 사진에서 볼 수 있습니다

. ScrollView를 제거하면 흰색 영역이 사라지지 않지만 유감스럽게도 내 인터페이스에서 ScrollView를 사용해야합니다. 항목에 내 목록을 채우면 흰색의 "영역"이 그대로 있고 항목 아래에 배치됩니다.

누구나 전에 본적이 있습니까? 어떤 이유로 ScrollView를 제거하지 않고 제거하려면 어떻게해야합니까? Ive는 fill_parent/wrap_content/0dip과 같은 설정의 모든 다른 유형을 지금까지 성공하지 않고 변경하려했습니다.

알고 계시다면 도와주세요!

<?xml version="1.0" encoding="utf-8"?> 


<ScrollView 
xmlns:android="http://schemas.android.com/apk/res/android" 
android:layout_height="fill_parent" 
android:layout_width="fill_parent"> 

<TableLayout 
     xmlns:android="http://schemas.android.com/apk/res/android" 
android:layout_width="fill_parent" 
android:layout_height="fill_parent" 
android:background="@drawable/orginalbild" 
android:fillViewport="true" 
android:gravity="center|top" 
android:orientation="vertical" 
android:stretchColumns="1" 
android:weightSum="1.0"> 

<TableRow 
    android:paddingTop="3dp" > 

<TextView 
      android:layout_width="0dip" 
      android:layout_height="fill_parent" 
      android:layout_weight="0.04"> 
      </TextView> 

      <EditText 
       android:id="@+id/search_task_field" 
       android:layout_width="0dip" 
       android:layout_height="fill_parent" 
       android:layout_weight="0.7" 
       android:hint="@string/SearchTaskHint" 
       /> 

      <ImageButton 
       android:id="@+id/search_task_button" 
       android:layout_width="0dip" 
       android:layout_height="50dp" 
       android:layout_gravity="center" 
       android:layout_weight="0.22" 

       android:src="@drawable/find3" /> 

      <TextView 
       android:layout_width="0dip" 
       android:layout_height="fill_parent" 
       android:layout_weight="0.04" 
       android:visibility="invisible" 
       > 
      </TextView> 
      </TableRow> 


     <TableRow 
    android:paddingTop="0.9dp" 
    android:paddingRight="0.9dp" 
    android:paddingLeft="0.9dp" 
    android:background="#90767878" 
    android:paddingBottom="0.9dp" 
    android:layout_marginLeft="24dp" 
    android:layout_marginRight="24dp" 
    android:layout_marginBottom="20dp" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent"> 

    <ListView 
     android:id="@+id/search_task_list" 
     android:layout_width="0dip" 
     android:layout_height="fill_parent" 
     android:layout_weight="1" 
     android:background="#FFFFFF" 
     android:gravity="left" 
     /> 
</TableRow> 
    </TableLayout> 
    </ScrollView> 
+0

필자있는 ScrollView 내에서 설정할 수 있습니다 내 대답을 편집 해 그 – Ahmad

답변

1

ListView를 ScrollView 내에 둘 수 없습니다. 그건 불가능하다. ListView에는 내용을 스크롤 할 수있는 두 가지 옵션이 있기 때문에 가능합니다. 그리고 이것은 효과가 없을 것입니다.

ListView 아래 또는 위에 내용을 표시하려는 경우 내용을 스크롤하려면 원하는 사용자 지정보기를 만들어야 할 수 있습니다. 자세한 내용은

:

https://groups.google.com/forum/m/?fromgroups#!topic/android-beginners/LRpLgGOy2Pc

편집 : 당신이 사용하는 내가 추천 할 것입니다 : https://github.com/thiagolocatelli/android-uitableview 사용자 지정 목록보기 및

관련 문제