2012-04-13 3 views
3

간단한 레이아웃 인 것처럼 보이지만 만드는 데 문제가 있습니다. 레이아웃은 헤더, 본문 인 webview 및 첨부 된 스케치에 표시된 바닥에 바닥 글 배너로 구성됩니다.남은 공간을 차지하는 Android webview 레이아웃

enter image description here

나는 머리글과 바닥 글 사이의 모든 나머지 공간을 취할 수있는 웹보기가 필요합니다.

나는이 시도 :

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout 
xmlns:android="http://schemas.android.com/apk/res/android" 
android:orientation="vertical" 
android:background="@drawable/back" 
android:layout_width="fill_parent" 
android:layout_height="fill_parent"> 
<ImageView 
android:id="@+id/banner" 
    android:layout_height="wrap_content" 
    android:layout_width="wrap_content" 
    android:src="@drawable/banner" /> 
<WebView 
    android:id="@+id/webview" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:background="@drawable/bck" 
    android:layout_weight="2" 
    android:layout_gravity="center"/> 
    <RelativeLayout 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_weight="4"> 
     <com.mobclix.android.sdk.MobclixMMABannerXLAdView 
       android:id="@+id/banner_adview" 
       android:layout_width="320dip" 
       android:layout_height="50dip" 
       android:layout_gravity="center" 
       android:layout_alignParentBottom="true" /> 
    </RelativeLayout> 

답변

2

는 RelativeLayout의 내부에 그들 모두를 넣고 웹보기에 = "@ 아이디/header_banner"및 layout_above = "@ + ID/footer_banner을 layout_below 사용 "

1

이 당신을 위해 작동합니다

<?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:id="@+id/ddd" 
    android:orientation="vertical" > 
    <ImageView 
    android:id="@+id/banner1" 
    android:layout_height="wrap_content" 
    android:layout_width="fill_parent" 
    android:src="@drawable/atm" /> 
    <WebView xmlns:android="http://schemas.android.com/apk/res/android" 
     android:id="@+id/webview1" 
     android:layout_width="fill_parent" 
     android:layout_height="fill_parent" 
     android:layout_weight="1" 
    /> 
    <ImageView 
    android:id="@+id/banner2" 
    android:layout_height="wrap_content" 
    android:layout_width="fill_parent" 
    android:layout_weight="0" 
    android:src="@drawable/atm" /> 
</LinearLayout> 
관련 문제