I’m trying to create a navigation bar with 5 buttons at the upper part of the screen.
I would like the buttons size to remain even on different screen sizes and stretched to the width of the screen.
The most suitable solution I found is table view.
The problem is that I can’t find a way to have only one table row and continue the rest of the screen with linear view.
In the following example, the EditText appears in the bottom of the screen and not directly after the navigation bar.
Any ideas?
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<TableRow android:layout_height="wrap_content" android:layout_width="fill_parent" android:layout_weight="1" android:id="@+id/tableRow2">
<Button android:layout_width="0dip" android:text="1" android:layout_weight="1" android:layout_height="wrap_content" android:id="@+id/n1"></Button>
<Button android:layout_width="0dip" android:text="2" android:layout_weight="1" android:layout_height="wrap_content" android:id="@+id/n2"></Button>
<Button android:layout_width="0dip" android:text="3" android:layout_weight="1" android:layout_height="wrap_content" android:id="@+id/n3"></Button>
<Button android:layout_width="0dip" android:text="4" android:layout_weight="1" android:layout_height="wrap_content" android:id="@+id/n4"></Button>
<Button android:layout_width="0dip" android:text="5" android:layout_weight="1" android:layout_height="wrap_content" android:id="@+id/n5" android:layout_margin="0"></Button>
</TableRow>
<EditText android:id="@+id/editText1" android:layout_height="wrap_content" android:layout_width="fill_parent" android:inputType="textPostalAddress">
<requestFocus></requestFocus>
</EditText>
</LinearLayout>
There is no need for a TableLayout
Add a
LinearLayout