android - Nest TableLayout inside LinearLayout - is it possible? -


i want produce android screen layout looks following:

label   text field label   text field label   text field  -----button------- -----textfield---- 

that is, want have tablelayout @ top, number of items underneath table layout (mainly can force these items @ bottom of screen). have tried nest them in code below, items @ bottom don't seem appear.

any ideas?

<?xml version="1.0" encoding="utf-8"?> <linearlayout     xmlns:android="http://schemas.android.com/apk/res/android"     android:layout_width="fill_parent"     android:layout_height="fill_parent"     android:orientation="vertical"> <tablelayout xmlns:android="http://schemas.android.com/apk/res/android"     android:layout_width="match_parent"     android:stretchcolumns="1"     android:shrinkcolumns="1" android:layout_height="wrap_content"  android:layout_gravity="center_vertical">     <tablerow>         <textview android:text="latitude:"         android:textappearance="?android:attr/textappearancelarge"         />         <textview android:id="@+id/latitude"         android:text="not available"         android:textappearance="?android:attr/textappearancelarge"         />     </tablerow>     <tablerow>         <textview android:text="longitude:"         android:textappearance="?android:attr/textappearancelarge"/>         <textview android:id="@+id/longitude"         android:text="not available"         android:textappearance="?android:attr/textappearancelarge"/>     </tablerow>     <tablerow>         <textview android:text="altitude:"         android:textappearance="?android:attr/textappearancelarge"/>         <textview android:id="@+id/altitude"         android:text="not available"         android:textappearance="?android:attr/textappearancelarge"/>     </tablerow>     <tablerow>         <textview android:text="accuracy:"         android:textappearance="?android:attr/textappearancelarge"/>         <textview android:id="@+id/accuracy"         android:text="not available"         android:textappearance="?android:attr/textappearancelarge"/>     </tablerow> </tablelayout> <button android:id="@+id/save"         android:layout_width="match_parent"         android:layout_height="wrap_content"         android:text="save"/> <textview android:text="test"/> </linearlayout> 

in table layout add these

android:layout_height="80dp"    android:layout_weight="1.0" 

also bottom button , and text view add fixed height.if table needs more space put between scrollview


Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

visual c++ - Using relative values in array sorting ( asm ) -