java - Add button at the bottom of layout and scrollview -


i have activity layout has 2 edittext , 3 buttons. want apply scrollview whole layout. last button should @ bottom of layout; should belong same scrollview other edittext , buttons.

this visual description:

the required output

what have done not allowing third button @ bottom of layout. have keep in mind screen sizes differ, positioning of third button should dynamic enough @ bottom of screen size , belong scrollview well.

my layout code:

<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:layout_alignparentbottom="false"     android:layout_centerhorizontal="true"     android:layout_centerinparent="false"     android:layout_centervertical="true"     android:orientation="vertical"     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=".adddetails" >      <scrollview         android:id="@+id/scrollview1"         android:layout_width="match_parent"         android:layout_height="match_parent"         android:layout_alignparenttop="true"         android:layout_centerhorizontal="true" >          <relativelayout             android:layout_width="match_parent"             android:layout_height="wrap_content" >              <relativelayout                 android:layout_width="match_parent"                 android:layout_height="match_parent"                 android:gravity="center"                  android:id="@+id/first_layout">                  <linearlayout                     android:layout_width="match_parent"                     android:layout_height="wrap_content"                     android:layout_margintop="92dp"                     android:focusable="true"                     android:focusableintouchmode="true"                     android:orientation="vertical" >                      <edittext                         android:id="@+id/firstnameedit"                         android:layout_width="match_parent"                         android:layout_height="wrap_content"                         android:hint="first name"                         android:lines="1"                         android:singleline="true"                         android:textsize="24sp" >                     </edittext>                      <edittext                         android:id="@+id/lastnameedit"                         android:layout_width="match_parent"                         android:layout_height="wrap_content"                         android:hint="last name"                         android:lines="1"                         android:singleline="true"                         android:textsize="24sp" />                      <edittext                         android:id="@+id/emailedit"                         android:layout_width="match_parent"                         android:layout_height="wrap_content"                         android:hint="email address"                         android:inputtype="textemailaddress"                         android:lines="1"                         android:singleline="true"                         android:textsize="24sp"                         android:visibility="gone" />                      <button                         android:id="@+id/locationedit"                         android:layout_width="wrap_content"                         android:layout_height="wrap_content"                         android:layout_margintop="24dp"                         android:lines="1"                         android:singleline="true"                         android:text="country"                         android:textcolor="#ffffff"                         android:textsize="20sp" />                      <button                         android:id="@+id/dateofbirthedit"                         android:layout_width="wrap_content"                         android:layout_height="wrap_content"                         android:layout_margintop="16dp"                         android:text="date of birth"                         android:textcolor="#ffffff"                         android:textsize="20sp" />                 </linearlayout>             </relativelayout>              <relativelayout                 android:id="@+id/relativelayout1"                 android:layout_width="match_parent"                 android:layout_height="wrap_content"                 android:layout_below="@+id/first_layout">                  <button                     android:id="@+id/nextscreenbtn"                     android:layout_width="match_parent"                     android:layout_height="wrap_content"                     android:background="@drawable/next_button_selector"                     android:text="next"                     android:textcolor="#ffffff"                     android:textsize="20sp" />             </relativelayout>         </relativelayout>     </scrollview>  </relativelayout> 

please suggest me way achieve same.

try code..

just use insted of 'scrollview' code..

     <scrollview                 android:layout_width="match_parent"                 android:layout_height="match_parent"                 android:fillviewport="true"                 android:scrollbars = "vertical"                 android:scrollbarstyle="insideinset" >       // continue code      </scrollview> 

Comments

Popular posts from this blog

java - Plugin org.apache.maven.plugins:maven-install-plugin:2.4 or one of its dependencies could not be resolved -

Round ImageView Android -

How can I utilize Yahoo Weather API in android -