2014-10-05 4 views
-1

이클립스에서는 모두보기에는 좋지만 줄과 목록보기 사이의 장치에는 큰 거리가 있습니다. 목록과 행 사이의 거리를 제거하는 방법은 무엇입니까? 다음은 XML 레이아웃 :ListView의 끝에 줄을 묶어

<?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="fill_parent" 
    android:background="@drawable/gradient" 
    android:orientation="vertical" > 
     <TextView 
      android:id="@+id/reminder" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:gravity="center" 
      />   
    <View 
    android:layout_width="match_parent" 
    android:layout_height="6dp" 
    android:background="@drawable/line_top" 
    android:layout_marginLeft="20dp" 
    android:layout_marginRight="20dp" 
    android:layout_marginTop="18dp"  
     /> 
    <ListView 
     android:id="@+id/mainList" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_marginLeft="20dp" 
     android:layout_marginRight="20dp" 
     android:layout_weight="0.91" 
     > 
    </ListView> 
    <View 
    android:layout_width="match_parent" 
    android:layout_height="6dp" 
     android:background="@drawable/line_bottom" 
    android:layout_marginLeft="20dp" 
    android:layout_marginRight="20dp" 
    android:layout_marginTop="18dp" 
    android:layout_marginBottom="18dp" 
     /> 
</LinearLayout> 

in eclipse! on device

답변

0

해당보기 내에 margin_top = "18dp"를 설정했습니다. listview로 설정된 레이아웃 가중치를 제거하십시오.

+0

감사합니다! 넌 나를 구했다. –

+0

행복하게 도와 드릴 수 있습니다. – Harsha

0

대신 relaytiveLayout를 사용할 수 있습니다

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:layout_width="fill_parent" 
android:layout_height="fill_parent" 
android:background="@drawable/gradient" 
android:orientation="vertical" > 
    <TextView 
     android:id="@+id/reminder" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:align_parentTop="true" 
     android:gravity="center" 
     />   
<View 
android:id="[email protected]/top_line" 
android:layout_width="match_parent" 
android:layout_height="6dp" 
android:background="@drawable/line_top" 
android:layout_below="[email protected]/reminder" 
android:layout_marginLeft="20dp" 
android:layout_marginRight="20dp" 
android:layout_marginTop="18dp"  
    /> 
<ListView 
    android:id="@+id/mainList" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_marginLeft="20dp" 
    android:layout_marginRight="20dp" 
    android:layout_below="[email protected]/top_line" 
    > 
</ListView> 
<View 
android:layout_width="match_parent" 
android:layout_height="6dp" 
    android:background="@drawable/line_bottom" 
android:layout_below="[email protected]/mainList" 
android:layout_marginLeft="20dp" 
android:layout_marginRight="20dp" 
android:layout_marginTop="18dp" 
android:layout_marginBottom="18dp" 
    /> 
</RelativeLayout > 
+0

또한 좋은 방법입니다. 답변 주셔서 감사합니다. –

관련 문제