【发布时间】:2011-04-21 07:25:44
【问题描述】:
我正在尝试将我创建的按钮栏放在每个屏幕的底部。我很容易成功地完成了第一个屏幕。
现在我已经尝试将它放到其他屏幕上,但它似乎无法粘在屏幕底部。当我查看 hiearchyviewer 时,它看起来像包裹在我的布局和按钮栏周围的 RelativeLayout,并没有填满整个屏幕,但是,它的高度设置为填充父项。
谁能帮我指出我哪里出错了?
这是我使用的 XML:
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:layout_height="fill_parent">
<RelativeLayout android:layout_width="fill_parent"
android:layout_height="fill_parent" android:orientation="vertical">
<TableLayout android:layout_width="fill_parent"
android:layout_height="fill_parent" android:padding="5pt" android:id="@+id/table"
android:stretchColumns="1">
<TableRow>
<TextView android:text="@string/Arbeiderbediende"
android:id="@+id/txtArbeiderBediende" android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</TableRow>
<TableRow android:gravity="center">
<RadioGroup android:layout_width="fill_parent"
android:layout_height="wrap_content" android:orientation="horizontal"
android:id="@+id/group1">
<RadioButton style="@style/RadioButton"
android:layout_width="wrap_content" android:id="@+id/rbArbeider"
android:text="@string/Arbeider" android:layout_height="wrap_content"
android:paddingLeft="18pt" />
<RadioButton style="@style/RadioButton"
android:layout_width="wrap_content" android:id="@+id/rbBediende"
android:text="@string/Bediende" android:layout_height="wrap_content"
android:layout_marginLeft="20pt" android:paddingLeft="18pt" />
</RadioGroup>
</TableRow>
<TableRow android:gravity="center" android:paddingTop="5dip">
<TextView android:text="@string/OverzichtFuncties"
android:id="@+id/txtFuncties" android:layout_width="0dip"
android:layout_weight="1" android:layout_height="wrap_content" />
<Spinner android:layout_height="wrap_content" style="Spinner"
android:layout_width="0dip" android:layout_weight="2"
android:id="@+id/cmbFuncties" />
</TableRow>
<TableRow android:gravity="center" android:paddingTop="5dip">
<TextView android:text="@string/Regio" android:id="@+id/txtRegio"
android:layout_width="0dip" android:layout_weight="1"
android:layout_height="wrap_content" />
<Spinner android:layout_height="wrap_content"
android:layout_width="0dip" android:layout_weight="2" android:id="@+id/cmbRegio" />
</TableRow>
<TableRow android:gravity="center" android:paddingTop="5dip">
<TextView android:text="@string/Opleiding" android:id="@+id/txtOpleidingsniveau"
android:layout_width="0dip" android:layout_weight="1"
android:layout_height="wrap_content" />
<Spinner android:layout_height="wrap_content"
android:layout_width="0dip" android:layout_weight="2"
android:id="@+id/cmbOpleidingsniveau" />
</TableRow>
<Button android:text="@string/VindJobButton" android:id="@+id/btnFindJob"
android:layout_width="fill_parent" android:layout_height="wrap_content"
android:layout_marginTop="10dip" />
</TableLayout>
<stage.accent.Toolbar android:layout_width="fill_parent"
android:layout_height="70dip" android:layout_alignParentBottom="true"
android:layout_below="@+id/table" />
</RelativeLayout>
这是我取得的结果,也是我想要得到的结果
【问题讨论】: