2012-07-11 2 views
0

겉으로보기에 단순한 레이아웃에 현재 문제가 있습니다. 정적 헤더 (로고 및 버튼 포함), WebView 및 정적 푸터 (가운데 버튼 포함)가 있습니다. 내가 제거 할 수없는 3 개의 공간이있는 것 같습니다 (공간이 빨간색이므로 루트 배경이 빨간색이므로 공간이 어디인지는 분명합니다).Android 레이아웃 격차 문제

어떻게하면 WebView가이 전체 공간을 채워서이 빨간색 배경이 사라지게 할 수 있습니까?

이 RelativeLayout의 레이아웃이나있는 LinearLayout 부모는 아마도 쓸모;

또한 이클립스 내 RelativeLayout의 블록 나에게 다음과 같은 경고를주고있다 나는 웹보기이 전체 공간을 채울 수있는 방법을 어떤 생각이 너무이 빨간색 배경이 사라지고 다른보기

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:id="@+id/commonlayout" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:background="#FF0000" 
    android:orientation="vertical" 
    android:padding="0dp" 
    android:weightSum="10" > 

    <LinearLayout 
     android:id="@+id/llheader" 
     android:layout_width="fill_parent" 
     android:layout_height="0dp" 
     android:layout_weight="1" > 

     <RelativeLayout 
      android:id="@+id/relativeLayout1" 
      android:layout_width="fill_parent" 
      android:layout_height="wrap_content" 
      android:layout_gravity="top" 
      android:background="@drawable/bgx" > 

      <Button 
       android:id="@+id/Button_logout" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:layout_alignParentRight="true" 
       android:layout_centerVertical="true" 
       android:layout_marginRight="2dp" 
       android:background="@drawable/ic_launcher" /> 

      <Button 
       android:id="@+id/Button_playlist" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:layout_alignParentLeft="true" 
       android:layout_centerVertical="true" 
       android:layout_marginLeft="2dp" 
       android:background="@drawable/logo" /> 
     </RelativeLayout> 
    </LinearLayout> 

    <LinearLayout 
     android:id="@+id/lldata" 
     android:layout_width="fill_parent" 
     android:layout_height="0dp" 
     android:layout_weight="8" 
     android:background="#00FF00" > 

     <WebView 
      xmlns:android="http://schemas.android.com/apk/res/android" 
      android:id="@+id/webview" 
      android:layout_width="fill_parent" 
      android:layout_height="fill_parent" /> 
    </LinearLayout> 

    <LinearLayout 
     android:id="@+id/llfooter" 
     android:layout_width="fill_parent" 
     android:layout_height="0dp" 
     android:layout_margin="0dp" 
     android:layout_weight="1" 
     android:gravity="center" 
     android:orientation="horizontal" 
     android:visibility="visible" > 

     <RelativeLayout 
      android:id="@+id/relativeLayout2" 
      android:layout_width="fill_parent" 
      android:layout_height="wrap_content" 
      android:layout_gravity="bottom" 
      android:background="@drawable/bgx" > 

      <Button 
       android:id="@+id/issue" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:layout_centerHorizontal="true" 
       android:background="@drawable/ic_launcher" 
       android:textColor="#FFFFFF" /> 
     </RelativeLayout> 
    </LinearLayout> 

</LinearLayout> 

enter image description here

답변

0

에 배경 속성을 전송?

웨이트 태그를 사용하여 webview 레이아웃에서 1을 시도해야합니다.

또는 webview의 레이아웃 상위를 제거하고 웨이트 1을 사용하여 직접 webview를 사용하십시오.