我想展开webview1视图来填充剩余空间。使按钮看起来像总是在屏幕的底部。 我使用android:layout_weight属性为每个孩子分配一个权重。 但它似乎不起作用。我该怎么办呢,有谁能够告诉我什么为什么不是视图展开来填充剩余空间
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<ScrollView style="@style/ScrollView" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:paddingBottom="8dp"
android:paddingLeft="12dp"
android:paddingRight="12dp"
android:paddingTop="8dp" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_marginTop="12dp"
android:orientation="vertical"
android:layout_weight="1" > <---here assign a weight
<WebView
android:id="@+id/webview1"
**style="@style/update_text" />**
</LinearLayout>
<!-- h-line -->
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="12dp" >
<ImageView
android:id="@+id/line_end"
style="@style/form_h_line" />
</RelativeLayout>
<!-- buttons -->
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:orientation="horizontal" >
<Space
android:layout_width="12dp"
android:layout_height="wrap_content"/>
<Button
android:id="@+id/button_ok"
style="@style/base_button"
android:layout_width="12dp"
android:layout_height="wrap_content"
android:layout_weight="2"
android:text="OK"/>
<Space
android:layout_width="12dp"
android:layout_height="wrap_content"/>
</LinearLayout>
</LinearLayout>
</ScrollView>
</FrameLayout>
的原因是,因为它工作在的FrameLayout,所以webview1不能自动扩展。
<空格代表什么? – KOTIOS