我想把我在每個屏幕底部創建的按鈕欄。我成功的第一個屏幕相當簡單。按鈕欄不會粘到屏幕底部
現在我試着把它放在其他屏幕上,但它似乎不能粘到屏幕的底部。當我查看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