2013-06-18 3 views
1

안녕하세요, 안드로이드 레이아웃 & 화면 하단에 공간이 있지만 여전히 Listview의 높이가 확장되지 않습니다. 단 한 행의 공간을 예약합니다.listview에서 채우기 부모가 작동하지 않습니다.

이 레이아웃에서 잘못된 점을 알려주십시오.

<?xml version="1.0" encoding="utf-8"?> 
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" 
    android:id="@+id/parentScrollView" 
    android:layout_width="fill_parent" 
    android:layout_height="match_parent" 
    android:background="@color/light_white" 
    android:orientation="vertical" > 

    <RelativeLayout 
     android:id="@+id/parentRelativeLayout" 
     android:layout_width="fill_parent" 
     android:layout_height="match_parent" > 

     <RelativeLayout 
      android:id="@+id/relativeLayoutforAds" 
      android:layout_width="fill_parent" 
      android:layout_height="wrap_content" 
      android:layout_centerHorizontal="true" /> 

     <LinearLayout 
      android:id="@+id/linearLayoutList" 
      android:layout_width="wrap_content" 
      android:layout_height="fill_parent" 
      android:layout_below="@id/relativeLayoutforAds" 
      android:background="@color/black" 
      android:orientation="vertical" > 

      <ListView 
       android:id="@android:id/list" 
       android:layout_width="fill_parent" 
       android:layout_height="fill_parent" /> 

     </LinearLayout> 
    </RelativeLayout> 

</ScrollView> 

enter image description here

+3

ScrollView 내에 ListView가 있습니다. 그것은 나쁜 것입니다 – Blackbelt

+0

http://stackoverflow.com/questions/3495890/how-can-i-put-a-listview-into-a-scrollview-without-it-collapsing –

+1

listview 자체를 스크롤합니다. 그냥 listview 있습니다. 불필요한 레이아웃을 모두 제거하십시오. – Raghunandan

답변

0

이 문제를 해결한다. 모두에게 제안을 보내 주셔서 감사합니다.

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:id="@+id/parentRelativeLayout" 
    android:layout_width="fill_parent" 
    android:layout_height="match_parent" > 

    <ScrollView 
     android:id="@+id/parentScrollView" 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:background="@color/light_white" 
     android:orientation="vertical" > 

     <RelativeLayout 
      android:id="@+id/relativeLayoutforAds" 
      android:layout_width="fill_parent" 
      android:layout_height="wrap_content" 
      android:layout_centerHorizontal="true" /> 
    </ScrollView> 

    <LinearLayout 
     android:id="@+id/linearLayoutList" 
     android:layout_width="wrap_content" 
     android:layout_height="fill_parent" 
     android:layout_below="@id/parentScrollView" 
     android:background="@android:color/white" 
     android:orientation="vertical" 
     android:layout_marginTop="30dip"> 

     <ListView 
      android:id="@android:id/list" 
      android:layout_width="fill_parent" 
      android:layout_height="fill_parent" /> 
    </LinearLayout> 

</RelativeLayout> 
관련 문제