我想把我在每个屏幕底部创建的按钮栏。我成功的第一个屏幕相当简单。按钮栏不会粘到屏幕底部
现在我试着把它放在其他屏幕上,但它似乎不能粘到屏幕的底部。当我查看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>
这是我所取得的成绩和结果,我想
但是,如果我的内容比屏幕大,我实现了'ScrollView',所以滚动不会成为问题,但是屏幕的最后一点,例如提交按钮,会在后面隐藏,你怎么解决这个问题? ? – Hannelore 2011-04-21 08:15:00
上面的示例使按钮栏始终可见(不会滚动显示内容)或者我误解了您,并且提交按钮不在按钮栏中? – rekaszeru 2011-04-21 08:20:29
是的,我希望按钮栏是固定的就像你上面显示的那样,然后有一个按钮,例如,它位于内容屏幕的底部,然后隐藏在按钮栏后面 – Hannelore 2011-04-21 08:23:08