xml - How do I set the Button all the way down of the main layout in Android? -


hi new in android , making simple xml layout , 1 button named show should end of main layout, not figure out how it, can give clue?

xml:

<relativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingbottom="@dimen/activity_vertical_margin" android:paddingleft="@dimen/activity_horizontal_margin" android:paddingright="@dimen/activity_horizontal_margin" android:paddingtop="@dimen/activity_vertical_margin" tools:context=".mainactivity" >  <tablelayout      android:id="@+id/form"     android:layout_width="fill_parent"     android:layout_height="wrap_content" >      <tablerow          android:id="@+id/fnamerow"         android:layout_width="fill_parent"         android:layout_height="wrap_content" >          <textview              android:id="@+id/fnametxt"             android:layout_width="wrap_content"             android:layout_height="wrap_content"              android:text="firstname"/>          <edittext              android:id="@+id/fnameedit"             android:layout_width="wrap_content"             android:layout_height="wrap_content" />"      </tablerow>      <tablerow          android:id="@+id/lnamerow"         android:layout_width="fill_parent"         android:layout_height="wrap_content" >          <textview              android:id="@+id/lnametxt"             android:layout_width="wrap_content"             android:layout_height="wrap_content"              android:text="lastname"/>          <edittext             android:id="@+id/lnameedit"             android:layout_width="wrap_content"             android:layout_height="wrap_content"             android:ems="10" >              <requestfocus />         </edittext>      </tablerow>  </tablelayout>  <button      android:id="@+id/showbtn"     android:layout_below="@id/form"     android:layout_width="fill_parent"     android:layout_height="wrap_content"     android:text="show" /> </relativelayout> 

try adding android:layout_alignparentbottom attribute button


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -