title: how to set a button at the bottom of a screen when the parent is a scroll view?
body: <p>I have a scrollView (this is a solution to support landscape computability)</p>
  
  <p>and in it one child- linearLayout.</p>
  
  <p>I want to pose a button at the bottom of a screen.</p>
  
  <p><code>layout_height = match_parent</code> is problematic as the scroll can be infinite.</p>
  
  <p>How can I do this, to be compatible to all screen resolution?</p>
  
  <p>this is my xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res/com.m"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:background="@color/blue_bg" &gt;
  
      &lt;LinearLayout
          android:id="@+id/rootLayout"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:gravity="center_horizontal"
          android:orientation="vertical" &gt;
  
          &lt;com.m.view.text.mTextView
              android:id="@+id/verifyHeaderText"
              style="@style/textOnBg"
              android:layout_gravity="center_horizontal"
              android:layout_marginBottom="30dp"
              android:layout_marginTop="50dp"
              android:text="ENTER VERIFICATION CODE"
              android:textAllCaps="true"
              android:textColor="@android:color/white"
              app:font_type="varela" /&gt;
  
  
          &lt;RelativeLayout
              android:layout_width="match_parent"
              android:layout_height="match_parent" &gt;
  
              &lt;LinearLayout
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"
                  android:background="@android:color/white"
                  android:paddingBottom="5dp"
                  android:paddingLeft="25dp"
                  android:paddingRight="25dp"
                  android:paddingTop="5dp" &gt;
  
                  &lt;LinearLayout
                      android:id="@+id/inputBox"
                      android:layout_width="match_parent"
                      android:layout_height="50dp"
                      android:layout_gravity="center_horizontal"
                      android:gravity="center"
                      android:background="@drawable/input_box_idle"
                      android:orientation="horizontal" &gt;
  
                      &lt;EditText
                          android:id="@+id/verificationCodeEditText"
                          style="@style/textOnBg"
                          android:layout_width="wrap_content"
                          android:layout_height="wrap_content"
                          android:background="@android:color/transparent"
                          android:hint="-  -  -  -  -"
                          android:inputType="number"
                          android:maxLength="5"
                          android:textColor="#00bcfe"
                          android:textSize="25dp"
                          android:textStyle="italic" &gt;
                      &lt;/EditText&gt;
                  &lt;/LinearLayout&gt;
              &lt;/LinearLayout&gt;
  
              &lt;Button
                  android:id="@+id/continueButton"
                  style="@style/textOnBg"
                  android:layout_width="250dp"
                  android:layout_height="50dp"
                  android:layout_alignParentBottom="true"
                  android:layout_centerHorizontal="true"
                  android:layout_marginBottom="10dp"
                  android:background="@drawable/btn_selector"
                  android:text="Continue"
                  android:textColor="#00bcfe"
                  android:textSize="16dp"
                  android:textStyle="italic" /&gt;
          &lt;/RelativeLayout&gt;
      &lt;/LinearLayout&gt;
  &lt;/ScrollView&gt;
  </code></pre>
  
  <p>this is the result on wide-screen</p>
  
  <p><img src="https://i.stack.imgur.com/MxQgU.png" alt="enter image description here">
  The button is in the bottom of the scroll which spans 3/4 of the whole screen</p>